------------------------------------------------------------------------------
| 1901 | |
| 1902 | //------------------------------------------------------------------------------ |
| 1903 | void vtkSVGContextDevice2D::ApplyTextPropertyStateToNodeForPath( |
| 1904 | vtkXMLDataElement* node, float x, float y) |
| 1905 | { |
| 1906 | vtkVector3d colord; |
| 1907 | this->TextProp->GetColor(colord.GetData()); |
| 1908 | vtkColor3ub color = { |
| 1909 | static_cast<unsigned char>((colord[0] * 255.) + 0.5), |
| 1910 | static_cast<unsigned char>((colord[1] * 255.) + 0.5), |
| 1911 | static_cast<unsigned char>((colord[2] * 255.) + 0.5), |
| 1912 | }; |
| 1913 | |
| 1914 | YConverter yConv(this->CanvasHeight); |
| 1915 | |
| 1916 | std::ostringstream xform; |
| 1917 | xform << "translate(" << x << "," << yConv(y) << ")"; |
| 1918 | |
| 1919 | node->SetAttribute("fill", ColorToString(color.GetData()).c_str()); |
| 1920 | node->SetFloatAttribute("fill-opacity", static_cast<float>(this->TextProp->GetOpacity())); |
| 1921 | |
| 1922 | node->SetAttribute("transform", xform.str().c_str()); |
| 1923 | } |
| 1924 | |
| 1925 | //------------------------------------------------------------------------------ |
| 1926 | void vtkSVGContextDevice2D::ApplyTransform() |
no test coverage detected