1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-05-16 10:54:53 +03:00

0023652: Non zoomable text with alignment slides away when zooming view

Alignment is applied after zoom persistence scaling
This commit is contained in:
apl 2012-12-19 18:11:33 +04:00
parent 08c28f5b83
commit b4c5c58ed4

View File

@ -556,7 +556,7 @@ void OpenGl_Display::RenderText (const wchar_t* str, const int is2d, const float
(GLdouble*)projMatrix, (GLdouble*)projMatrix,
(GLint*)viewport, (GLint*)viewport,
&wx, &wy, &wz ); &wx, &wy, &wz );
glLoadIdentity();
gluUnProject( wx, wy, wz, gluUnProject( wx, wy, wz,
(GLdouble*)identityMatrix, (GLdouble*)projMatrix, (GLint*)viewport, (GLdouble*)identityMatrix, (GLdouble*)projMatrix, (GLint*)viewport,
&x1, &y1 , &z1 ); &x1, &y1 , &z1 );
@ -569,9 +569,9 @@ void OpenGl_Display::RenderText (const wchar_t* str, const int is2d, const float
h = (y2-y1)/h; h = (y2-y1)/h;
glTranslated( x1, y1 , z1 ); glLoadIdentity();
glRotated(aspect->Angle(), 0, 0, 1); glTranslated (x1, y1 , z1);
glTranslated(xdis, ydis, 0); glRotated (aspect->Angle(), 0, 0, 1);
if( !aspect->IsZoomable() ) if( !aspect->IsZoomable() )
{ {
@ -597,6 +597,8 @@ void OpenGl_Display::RenderText (const wchar_t* str, const int is2d, const float
{ {
export_h = (float)h; export_h = (float)h;
} }
glTranslated (xdis, ydis, 0);
} }
GLint renderMode; GLint renderMode;