Reviewed by eseidel.
[WebKit-https.git] / WebCore / kcanvas / RenderPath.cpp
index 15fcb53601f7a54c018c9c2f25c3a4a186134183..031d533a370bf3d44c3122f3c38beb03a078b7a7 100644 (file)
@@ -314,6 +314,7 @@ enum MarkerType {
 
 struct MarkerData {
     FloatPoint origin;
+    FloatPoint subpathStart;
     double strokeWidth;
     FloatPoint inslopePoints[2];
     FloatPoint outslopePoints[2];
@@ -335,6 +336,7 @@ DrawMarkersData::DrawMarkersData(GraphicsContext* c, KCanvasMarker *start, KCanv
     , midMarker(mid)
 {
     previousMarkerData.origin = FloatPoint();
+    previousMarkerData.subpathStart = FloatPoint();
     previousMarkerData.strokeWidth = strokeWidth;
     previousMarkerData.marker = start;
     previousMarkerData.type = Start;
@@ -382,11 +384,17 @@ static inline void updateMarkerDataForElement(MarkerData &previousMarkerData, co
         previousMarkerData.origin = points[2];
         break;
     case PathElementMoveToPoint:
+        previousMarkerData.subpathStart = points[0];
     case PathElementAddLineToPoint:
-    case PathElementCloseSubpath:
         previousMarkerData.inslopePoints[0] = previousMarkerData.origin;
         previousMarkerData.inslopePoints[1] = points[0];
         previousMarkerData.origin = points[0];
+        break;
+    case PathElementCloseSubpath:
+        previousMarkerData.inslopePoints[0] = previousMarkerData.origin;
+        previousMarkerData.inslopePoints[1] = points[0];
+        previousMarkerData.origin = previousMarkerData.subpathStart;
+        previousMarkerData.subpathStart = FloatPoint();
     }
 }