diff --git a/splash/Splash.cc b/splash/Splash.cc
index 5bc7767..11bd430 100644
--- a/splash/Splash.cc
+++ b/splash/Splash.cc
@@ -2538,6 +2538,7 @@ SplashError Splash::fillWithPattern(SplashPath *path, GBool eo,
     scanner->getBBox(&xMinI, &yMinI, &xMaxI, &yMaxI);
   }
 
+  Guchar lineShape = 255;
   if (eo && (yMinI == yMaxI || xMinI == xMaxI) && thinLineMode != splashThinLineDefault) {
     SplashCoord delta, xMinFP, yMinFP, xMaxFP, yMaxFP;
     getBBoxFP(path, &xMinFP, &yMinFP, &xMaxFP, &yMaxFP);
@@ -2548,6 +2549,11 @@ SplashError Splash::fillWithPattern(SplashPath *path, GBool eo,
       delete xPath;
       return splashOk;
     }
+    if (thinLineMode == splashThinLineShape) {
+      // set line shape for thin lines:
+      adjustLine = gTrue;
+      lineShape = clip255(delta * 256);
+    }
   }
 
   // check clipping
@@ -2567,9 +2573,7 @@ SplashError Splash::fillWithPattern(SplashPath *path, GBool eo,
 	if (clipRes != splashClipAllInside) {
 	  state->clip->clipAALine(aaBuf, &x0, &x1, y, thinLineMode != splashThinLineDefault && xMinI == xMaxI);
 	}
-	Guchar lineShape = 255;
-	GBool adjustLine = gFalse;
-	if (thinLineMode == splashThinLineShape && (xMinI == xMaxI || yMinI == yMaxI)) {
+	if (!eo && thinLineMode == splashThinLineShape && (xMinI == xMaxI || yMinI == yMaxI)) {
 	  // compute line shape for thin lines:
 	  SplashCoord mx, my, delta;
 	  transform(state->matrix, 0, 0, &mx, &my);
