File tree Expand file tree Collapse file tree
octproz_project/octproz/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -334,13 +334,17 @@ void GLWindow2D::paintGL() {
334334 glTranslatef (this ->xTranslation , this ->yTranslation , 0 );
335335
336336 // rotation
337- float screenWidth = static_cast <float >(this ->size ().width ());
338- float screenHeight = static_cast <float >(this ->size ().height ());
339- glScalef (1 .0f ,screenWidth/screenHeight,1 .0f );
340- glRotatef (this ->rotationAngle , 0.0 , 0.0 , 1.0 );
341- glScalef (1 .0f ,screenHeight/screenWidth,1 .0f );
337+ if (this ->keepAspectRatio ){
338+ float screenWidth = static_cast <float >(this ->size ().width ());
339+ float screenHeight = static_cast <float >(this ->size ().height ());
340+ glScalef (1 .0f ,screenWidth/screenHeight,1 .0f );
341+ glRotatef (this ->rotationAngle , 0.0 , 0.0 , 1.0 );
342+ glScalef (1 .0f ,screenHeight/screenWidth,1 .0f );
343+ }else {
344+ glRotatef (this ->rotationAngle , 0.0 , 0.0 , 1.0 );
345+ }
342346
343- // zoom
347+ // zoom and stretch
344348 glScalef (this ->scaleFactor *this ->stretchX , this ->scaleFactor *this ->stretchY , 0 .f );
345349
346350 // display oct data
You can’t perform that action at this time.
0 commit comments