From: apl Date: Wed, 19 Dec 2012 14:11:33 +0000 (+0400) Subject: 0023652: Non zoomable text with alignment slides away when zooming view X-Git-Tag: V6_6_0_beta~138 X-Git-Url: http://git.dev.opencascade.org/gitweb/?p=occt.git;a=commitdiff_plain;h=b4c5c58ed4a3ddef3e5fe21f8bba57cbd2e10aeb;hp=08c28f5b83f98f739ca15af6767b3ef6639b1f33 0023652: Non zoomable text with alignment slides away when zooming view Alignment is applied after zoom persistence scaling --- diff --git a/src/OpenGl/OpenGl_Display_1.cxx b/src/OpenGl/OpenGl_Display_1.cxx index 0e954ebffd..e7f06e9188 100644 --- a/src/OpenGl/OpenGl_Display_1.cxx +++ b/src/OpenGl/OpenGl_Display_1.cxx @@ -556,7 +556,7 @@ void OpenGl_Display::RenderText (const wchar_t* str, const int is2d, const float (GLdouble*)projMatrix, (GLint*)viewport, &wx, &wy, &wz ); - glLoadIdentity(); + gluUnProject( wx, wy, wz, (GLdouble*)identityMatrix, (GLdouble*)projMatrix, (GLint*)viewport, &x1, &y1 , &z1 ); @@ -569,9 +569,9 @@ void OpenGl_Display::RenderText (const wchar_t* str, const int is2d, const float h = (y2-y1)/h; - glTranslated( x1, y1 , z1 ); - glRotated(aspect->Angle(), 0, 0, 1); - glTranslated(xdis, ydis, 0); + glLoadIdentity(); + glTranslated (x1, y1 , z1); + glRotated (aspect->Angle(), 0, 0, 1); if( !aspect->IsZoomable() ) { @@ -597,6 +597,8 @@ void OpenGl_Display::RenderText (const wchar_t* str, const int is2d, const float { export_h = (float)h; } + + glTranslated (xdis, ydis, 0); } GLint renderMode;