Commit 87f9baa6 authored by Dan Lipsa's avatar Dan Lipsa

Shift quad position with one pixel to fix multiLineText test.

parent 85812c7b
......@@ -505,17 +505,19 @@ void vtkTextMapper::UpdateQuad(vtkActor2D *actor, int dpi)
text_bbox[0] = 0;
text_bbox[2] = 0;
}
// adjust the quad so that the anchor point and a point with the same
// coordinates fall on the same pixel.
double shiftPixel = 1;
double x = static_cast<double>(text_bbox[0]);
double y = static_cast<double>(text_bbox[2]);
double w = static_cast<double>(this->TextDims[0]);
double h = static_cast<double>(this->TextDims[1]);
this->Points->Reset();
this->Points->InsertNextPoint(x, y, 0.);
this->Points->InsertNextPoint(x, y + h, 0.);
this->Points->InsertNextPoint(x + w, y + h, 0.);
this->Points->InsertNextPoint(x + w, y, 0.);
this->Points->InsertNextPoint(x - shiftPixel, y - shiftPixel, 0.);
this->Points->InsertNextPoint(x - shiftPixel, y + h - shiftPixel, 0.);
this->Points->InsertNextPoint(x + w - shiftPixel, y + h - shiftPixel, 0.);
this->Points->InsertNextPoint(x + w - shiftPixel, y - shiftPixel, 0.);
this->CoordsTime.Modified();
}
}
......
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