summaryrefslogtreecommitdiff
path: root/splash
diff options
context:
space:
mode:
authorThomas Freitag <Thomas.Freitag@alfa.de>2013-02-23 23:39:52 +0100
committerAlbert Astals Cid <aacid@kde.org>2013-02-23 23:39:52 +0100
commitf96cbacfdbc97ace35f843854992f06e9322f485 (patch)
tree1b218b1b7389694c354d7360a27cd2b8084ba194 /splash
parent47453a78e52aa43edd148aef53b67306603161f5 (diff)
Refine splashThinLineShape support
Diffstat (limited to 'splash')
-rw-r--r--splash/Splash.cc14
1 files changed, 11 insertions, 3 deletions
diff --git a/splash/Splash.cc b/splash/Splash.cc
index 3a355b8d..bc8c62d7 100644
--- a/splash/Splash.cc
+++ b/splash/Splash.cc
@@ -2456,9 +2456,17 @@ SplashError Splash::fillWithPattern(SplashPath *path, GBool eo,
if (clipRes != splashClipAllInside) {
state->clip->clipAALine(aaBuf, &x0, &x1, y, thinLineMode != splashThinLineDefault && xMinI == xMaxI);
}
- drawAALine(&pipe, x0, x1, y,
- thinLineMode == splashThinLineShape && (xMinI == xMaxI || yMinI == yMaxI),
- clip255(splashRound(state->lineWidth * 255)));
+ Guchar lineShape = 255;
+ GBool adjustLine = gFalse;
+ if (thinLineMode == splashThinLineShape && (xMinI == xMaxI || yMinI == yMaxI)) {
+ // compute line shape for thin lines:
+ SplashCoord mx, my, delta;
+ transform(state->matrix, 0, 0, &mx, &my);
+ transform(state->matrix, state->lineWidth, 0, &delta, &my);
+ adjustLine = gTrue;
+ lineShape = clip255((delta - mx) * 255);
+ }
+ drawAALine(&pipe, x0, x1, y, adjustLine, lineShape);
}
} else {
for (y = yMinI; y <= yMaxI; ++y) {