Bug #1236 » wt-bug-1236-fix.diff
src/Wt/WRasterImage.C | ||
---|---|---|
{
|
||
internalInit();
|
||
// map point (1, 1) to convert device 0.5 to relative coordinates
|
||
double test_x, test_y;
|
||
painter()->combinedTransform().inverted().map(1, 1, &test_x, &test_y);
|
||
double shift = std::sqrt(test_x * test_x + test_y * test_y);
|
||
const std::vector<WPainterPath::Segment>& segments = path.segments();
|
||
if (segments.size() > 0
|
||
&& segments[0].type() != WPainterPath::Segment::MoveTo)
|
||
DrawPathMoveToAbsolute(context_, -0.5, -0.5);
|
||
DrawPathMoveToAbsolute(context_, -shift, -shift);
|
||
for (unsigned i = 0; i < segments.size(); ++i) {
|
||
const WPainterPath::Segment s = segments[i];
|
||
switch (s.type()) {
|
||
case WPainterPath::Segment::MoveTo:
|
||
DrawPathMoveToAbsolute(context_, s.x() - 0.5, s.y() - 0.5);
|
||
DrawPathMoveToAbsolute(context_, s.x() - shift, s.y() - shift);
|
||
break;
|
||
case WPainterPath::Segment::LineTo:
|
||
DrawPathLineToAbsolute(context_, s.x() - 0.5, s.y() - 0.5);
|
||
DrawPathLineToAbsolute(context_, s.x() - shift, s.y() - shift);
|
||
break;
|
||
case WPainterPath::Segment::CubicC1: {
|
||
const double x1 = s.x();
|
||
... | ... | |
const double x3 = segments[i+2].x();
|
||
const double y3 = segments[i+2].y();
|
||
DrawPathCurveToAbsolute(context_, x1 - 0.5, y1 - 0.5,
|
||
x2 - 0.5, y2 - 0.5,
|
||
x3 - 0.5, y3 - 0.5);
|
||
DrawPathCurveToAbsolute(context_, x1 - shift, y1 - shift,
|
||
x2 - shift, y2 - shift,
|
||
x3 - shift, y3 - shift);
|
||
i += 2;
|
||
break;
|
||
... | ... | |
const int fs = (deltaTheta > 0 ? 1 : 0);
|
||
if (!fequal(current.x(), x1) || !fequal(current.y(), y1))
|
||
DrawPathLineToAbsolute(context_, x1 - 0.5, y1 - 0.5);
|
||
DrawPathLineToAbsolute(context_, x1 - shift, y1 - shift);
|
||
DrawPathEllipticArcAbsolute(context_, rx, ry, 0, fa, fs,
|
||
x2 - 0.5, y2 - 0.5);
|
||
x2 - shift, y2 - shift);
|
||
i += 2;
|
||
break;
|
||
... | ... | |
const double x2 = segments[i+1].x();
|
||
const double y2 = segments[i+1].y();
|
||
DrawPathCurveToQuadraticBezierAbsolute(context_, x1 - 0.5, y1 - 0.5,
|
||
x2 - 0.5, y2 - 0.5);
|
||
DrawPathCurveToQuadraticBezierAbsolute(context_, x1 - shift, y1 - shift,
|
||
x2 - shift, y2 - shift);
|
||
i += 1;
|
||
- « Previous
- 1
- 2
- 3
- Next »