0027624: ViewerTest - vdrawtext command ignores text display options
authorsan <san@opencascade.com>
Mon, 20 Jun 2016 16:17:56 +0000 (19:17 +0300)
committerbugmaster <bugmaster@opencascade.com>
Thu, 23 Jun 2016 15:14:49 +0000 (18:14 +0300)
vdrawtext command was corrected to set the specified text display type
regardless of other options.

src/ViewerTest/ViewerTest_ObjectCommands.cxx
tests/bugs/vis/bug27624 [new file with mode: 0644]

index dfe1ff9..a3cefaf 100644 (file)
@@ -2842,10 +2842,11 @@ static int VDrawText (Draw_Interpretor& theDI,
     aTextPrs->SetOrientation3D (gp_Ax2 (aPos, aNormal, aDirection));
   }
 
+  aTextPrs->SetDisplayType (aDisplayType);
+
   if (aTrsfPersFlags != Graphic3d_TMF_None)
   {
     aTextPrs->SetTransformPersistence (aTrsfPersFlags, aTPPosition);
-    aTextPrs->SetDisplayType (aDisplayType);
     aTextPrs->SetZLayer(Graphic3d_ZLayerId_TopOSD);
     if (aTextPrs->Position().Z() != 0)
     {
@@ -2855,7 +2856,6 @@ static int VDrawText (Draw_Interpretor& theDI,
   else if (aTrsfPersFlags != aTextPrs->TransformPersistence().Flags)
   {
     aTextPrs->SetTransformPersistence (aTrsfPersFlags);
-    aTextPrs->SetDisplayType (Aspect_TODT_NORMAL);
   }
   ViewerTest::Display (aName, aTextPrs, Standard_False);
   return 0;
diff --git a/tests/bugs/vis/bug27624 b/tests/bugs/vis/bug27624
new file mode 100644 (file)
index 0000000..b8fc4c6
--- /dev/null
@@ -0,0 +1,14 @@
+puts "========"
+puts "CR27624"
+puts "========"
+puts ""
+##################################################################
+puts "Draw Harness, ViewerTest - vdrawtext command ignores text display options"
+##################################################################
+
+vfont add [locate_data_file DejaVuSans.ttf] SansFont
+
+vinit
+vdrawtext t1 "Subtitle" -height 20 -font SansFont -color 0 1 0 -disptype subtitle -subcolor 0.3 0.3 0.3
+vfit
+vdump $imagedir/${casename}.png