MCPcopy Create free account
hub / github.com/Kitware/VTK / Paint

Method Paint

Rendering/Matplotlib/Testing/Cxx/TestGL2PSMathTextScaling.cxx:67–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65vtkStandardNewMacro(GL2PSMathTextScalingTest);
66
67bool GL2PSMathTextScalingTest::Paint(vtkContext2D* painter)
68{
69 painter->GetBrush()->SetColor(50, 50, 128);
70 painter->DrawRect(0, 0, 500, 500);
71
72 painter->GetTextProp()->SetColor(.7, .4, .5);
73 painter->GetTextProp()->SetJustificationToLeft();
74 painter->GetTextProp()->SetVerticalJustificationToCentered();
75 painter->GetTextProp()->UseTightBoundingBoxOn();
76
77 for (int i = 0; i < 10; ++i)
78 {
79 int fontSize = 5 + i * 3;
80 float y = 500 - ((pow(i, 1.2) + 0.5) * 30);
81 painter->GetTextProp()->SetFontSize(fontSize);
82 painter->DrawString(5, y, "Text");
83 painter->DrawMathTextString(120, y, "MathText$\\ast$");
84 }
85
86 return true;
87}

Callers

nothing calls this directly

Calls 8

DrawRectMethod · 0.80
GetTextPropMethod · 0.80
SetFontSizeMethod · 0.80
powFunction · 0.50
SetColorMethod · 0.45
GetBrushMethod · 0.45
DrawStringMethod · 0.45
DrawMathTextStringMethod · 0.45

Tested by

no test coverage detected