From 353474f083c82fe53289992b94f4413a38385e0d Mon Sep 17 00:00:00 2001 From: kgv Date: Thu, 7 Aug 2014 14:11:28 +0400 Subject: [PATCH] 0025121: Visualization, OpenGl_Text - correct scaling factor for fixed-size text at 3D point Test case for issue #25121 --- src/OpenGl/OpenGl_Text.cxx | 2 +- tests/bugs/vis/bug25121 | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 tests/bugs/vis/bug25121 diff --git a/src/OpenGl/OpenGl_Text.cxx b/src/OpenGl/OpenGl_Text.cxx index 4b95885043..a5e7f37098 100755 --- a/src/OpenGl/OpenGl_Text.cxx +++ b/src/OpenGl/OpenGl_Text.cxx @@ -696,7 +696,7 @@ void OpenGl_Text::render (const Handle(OpenGl_PrinterContext)& thePrintCtx, GLdouble x2, y2, z2; const GLdouble h = (GLdouble )myFont->FTFont()->PointSize(); - gluUnProject (myWinX, myWinY + h - 1.0, myWinZ, + gluUnProject (myWinX, myWinY + h, myWinZ, (GLdouble* )THE_IDENTITY_MATRIX, myProjMatrix, myViewport, &x2, &y2, &z2); diff --git a/tests/bugs/vis/bug25121 b/tests/bugs/vis/bug25121 new file mode 100644 index 0000000000..5b660f2005 --- /dev/null +++ b/tests/bugs/vis/bug25121 @@ -0,0 +1,25 @@ +puts "================" +puts "OCC25121" +puts "================" +puts "" +####################################################################################### +# Visualization, OpenGl_Text - correct scaling factor for fixed-size text at 3D point +####################################################################################### + +vinit + +box b -5 -5 0 10 10 1 +vdisplay -noupdate b +vtop +vfit + +vdrawtext "000 3D" 0.0 0.0 0.0 255 255 255 1 1 000 0 16 1 Courier +vdrawtext "001 3D" 0.0 1.0 0.0 255 255 255 1 1 000 0 16 1 Courier +vdrawtext "101 3D" 0.0 2.0 0.0 255 255 255 1 1 000 0 16 1 Courier +vdrawtext "110 3D" 0.0 3.0 0.0 255 255 255 1 1 000 0 16 1 Courier +voverlaytext "000 2D" 100 200 16 Courier 255 255 255 normal 0 0 255 +voverlaytext "001 2D" 100 250 16 Courier 255 255 255 normal 0 0 255 +voverlaytext "101 2D" 100 300 16 Courier 255 255 255 normal 0 0 255 +voverlaytext "110 2D" 100 350 16 Courier 255 255 255 normal 0 0 255 + +set only_screen 1