diff options
Diffstat (limited to 'splash')
-rw-r--r-- | splash/Splash.cc | 8 | ||||
-rw-r--r-- | splash/Splash.h | 6 |
2 files changed, 10 insertions, 4 deletions
diff --git a/splash/Splash.cc b/splash/Splash.cc index 70584ec4..feb738bb 100644 --- a/splash/Splash.cc +++ b/splash/Splash.cc @@ -21,7 +21,7 @@ // Copyright (C) 2012 Matthias Kramm <kramm@quiss.org> // Copyright (C) 2018, 2019 Stefan Brüns <stefan.bruens@rwth-aachen.de> // Copyright (C) 2018 Adam Reichold <adam.reichold@t-online.de> -// Copyright (C) 2019 Oliver Sander <oliver.sander@tu-dresden.de> +// Copyright (C) 2019, 2020 Oliver Sander <oliver.sander@tu-dresden.de> // Copyright (C) 2019 Marek Kasik <mkasik@redhat.com> // // To see a description of the changes please see the Changelog file that @@ -6356,7 +6356,8 @@ void Splash::dumpXPath(SplashXPath *path) { } SplashError Splash::shadedFill(SplashPath *path, bool hasBBox, - SplashPattern *pattern) { + SplashPattern *pattern, + bool clipToStrokePath) { SplashPipe pipe; int xMinI, yMinI, xMaxI, yMaxI, x0, x1, y; SplashClipResult clipRes; @@ -6397,7 +6398,8 @@ SplashError Splash::shadedFill(SplashPath *path, bool hasBBox, yMaxI = state->clip->getYMaxI(); } - pipeInit(&pipe, 0, yMinI, pattern, nullptr, (unsigned char)splashRound(state->fillAlpha * 255), vectorAntialias && !hasBBox, false); + unsigned char alpha = splashRound((clipToStrokePath) ? state->strokeAlpha * 255 : state->fillAlpha * 255); + pipeInit(&pipe, 0, yMinI, pattern, nullptr, alpha, vectorAntialias && !hasBBox, false); // draw the spans if (vectorAntialias) { diff --git a/splash/Splash.h b/splash/Splash.h index 28ea4e5d..16b41c0a 100644 --- a/splash/Splash.h +++ b/splash/Splash.h @@ -16,6 +16,7 @@ // Copyright (C) 2010-2013, 2015 Thomas Freitag <Thomas.Freitag@alfa.de> // Copyright (C) 2010 Christian Feuersänger <cfeuersaenger@googlemail.com> // Copyright (C) 2012, 2017 Adrian Johnson <ajohnson@redneon.com> +// Copyright (C) 2020 Oliver Sander <oliver.sander@tu-dresden.de> // // To see a description of the changes please see the Changelog file that // came with your tarball or type make ChangeLog if you are building from git @@ -264,8 +265,11 @@ public: #endif // Do shaded fills with dynamic patterns + // + // clipToStrokePath: Whether the current clip region is a stroke path. + // In that case, strokeAlpha is used rather than fillAlpha. SplashError shadedFill(SplashPath *path, bool hasBBox, - SplashPattern *pattern); + SplashPattern *pattern, bool clipToStrokePath); // Draw a gouraud triangle shading. bool gouraudTriangleShadedFill(SplashGouraudColor *shading); |