From 52ec2775921d97c120b6f28edc19d5c82cd908b2 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Fri, 5 Apr 2013 15:10:58 +0200 Subject: [PATCH] Fixed bug of displaying stroked rectangles on wrong layer depth. --- common/gal/opengl/opengl_gal.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/common/gal/opengl/opengl_gal.cpp b/common/gal/opengl/opengl_gal.cpp index 853c69d5d4..33ef29e86e 100644 --- a/common/gal/opengl/opengl_gal.cpp +++ b/common/gal/opengl/opengl_gal.cpp @@ -819,10 +819,6 @@ void OPENGL_GAL::DrawRectangle( VECTOR2D aStartPoint, VECTOR2D aEndPoint ) selectShader( -1 ); - glPushMatrix(); - - glTranslated( 0, 0, layerDepth ); - // Stroke the outline if( isStrokeEnabled ) { @@ -841,15 +837,13 @@ void OPENGL_GAL::DrawRectangle( VECTOR2D aStartPoint, VECTOR2D aEndPoint ) { glColor4d( fillColor.r, fillColor.g, fillColor.b, fillColor.a ); glBegin( GL_QUADS ); - glVertex2d( aStartPoint.x, aStartPoint.y ); - glVertex2d( diagonalPointA.x, diagonalPointA.y ); - glVertex2d( aEndPoint.x, aEndPoint.y ); - glVertex2d( diagonalPointB.x, diagonalPointB.y ); + glVertex3d( aStartPoint.x, aStartPoint.y, layerDepth ); + glVertex3d( diagonalPointA.x, diagonalPointA.y, layerDepth ); + glVertex3d( aEndPoint.x, aEndPoint.y, layerDepth ); + glVertex3d( diagonalPointB.x, diagonalPointB.y, layerDepth ); glEnd(); } - glPopMatrix(); - // Restore the stroke color glColor4d( strokeColor.r, strokeColor.g, strokeColor.b, strokeColor.a ); }