Commit 0edc2568 authored by David C. Lonie's avatar David C. Lonie

Strip newlines from GL2PS comments.

These are messing up the exported files.

Change-Id: I49a0470a05850ec36fc82175d7e8b2df5fb8705f
parent ae47eefb
......@@ -259,20 +259,29 @@ void vtkGL2PSUtilities::DrawPath(vtkPath *path, double rasterPos[3],
double scale[2], double rotateAngle,
float strokeWidth, const char *label)
{
// Replace newlines in label -- these will throw off the comments.
std::string l(label ? label : "");
size_t idx = 0;
while ((idx = l.find('\n', idx)) != std::string::npos)
{
l.replace(idx, 1, "\\n");
}
switch (gl2psGetFileFormat())
{
case GL2PS_PS:
case GL2PS_EPS:
vtkGL2PSUtilities::DrawPathPS(path, rasterPos, windowPos, rgba, scale,
rotateAngle, strokeWidth, label);
rotateAngle, strokeWidth, l.c_str());
break;
case GL2PS_SVG:
vtkGL2PSUtilities::DrawPathSVG(path, rasterPos, windowPos, rgba, scale,
rotateAngle, strokeWidth, label);
rotateAngle, strokeWidth, l.c_str());
break;
case GL2PS_PDF:
vtkGL2PSUtilities::DrawPathPDF(path, rasterPos, windowPos, rgba, scale,
rotateAngle, strokeWidth, label);
rotateAngle, strokeWidth, l.c_str());
break;
default:
break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment