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

Function GetSpaceStr

Rendering/GL2PSOpenGL2/vtkOpenGLGL2PSHelperImpl.cxx:56–65  ·  view source on GitHub ↗

replace \n with space as PS treats it as a space but PDF just removes them. we also need this so that we get the correct bounding box for PDFs considering that we do not address multi-line strings yet.

Source from the content-addressed store, hash-verified

54// we also need this so that we get the correct bounding box for PDFs
55// considering that we do not address multi-line strings yet.
56void GetSpaceStr(const char* str, std::string* spaceStr)
57{
58 *spaceStr = str;
59 std::string::size_type eolPos = 0;
60 while ((eolPos = spaceStr->find('\n', eolPos)) != std::string::npos)
61 {
62 spaceStr->replace(eolPos, 1, 1, ' ');
63 ++eolPos;
64 }
65}
66
67/**
68 * Computes the bottom left corner 'blpos' and a string with \n replaced

Callers 1

DrawStringMethod · 0.85

Calls 1

findMethod · 0.45

Tested by

no test coverage detected