Reviewed by eseidel.
authorrwlbuis <rwlbuis@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Sep 2006 07:29:08 +0000 (07:29 +0000)
committerrwlbuis <rwlbuis@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Sep 2006 07:29:08 +0000 (07:29 +0000)
        http://bugzilla.opendarwin.org/show_bug.cgi?id=10946
        new marker code draws end-marker in wrong place

        Keep track of the start of the subpath so we can handle
        closeTo/moveTo correctly.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@16494 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/svg/W3C-SVG-1.1/painting-marker-02-f-expected.checksum
LayoutTests/svg/W3C-SVG-1.1/painting-marker-02-f-expected.png
LayoutTests/svg/custom/invalid-css-expected.txt
WebCore/ChangeLog
WebCore/kcanvas/RenderPath.cpp

index 350880246915c3facee0cde27e4517544d2bad6f..3f51d9b3d197237d445b5449f1d0def1d10b0c4e 100644 (file)
@@ -1,3 +1,15 @@
+2006-09-20  Rob Buis  <buis@kde.org>
+
+        Reviewed by eseidel.
+
+        Updated test results because of:
+        http://bugzilla.opendarwin.org/show_bug.cgi?id=10946
+        new marker code draws end-marker in wrong place
+
+        * svg/W3C-SVG-1.1/painting-marker-02-f-expected.checksum:
+        * svg/W3C-SVG-1.1/painting-marker-02-f-expected.png:
+        * svg/custom/invalid-css-expected.txt:
+
 2006-09-20  Julien Palmas  <julien.palmas@gmail.com>
 
         Reviewed by eseidel.  Landed by eseidel.
index 3321b3114fbcc1240c28637a97a0b75908e7bdda..a8fc04c8ef0a0242cada7bd452bcc42fc61b6b75 100644 (file)
@@ -1 +1 @@
-f90560719f7dd6a54697f9647eea3720
\ No newline at end of file
+ec702311470c62ec967603a109d90101
\ No newline at end of file
index b719a482150980cefd9572e0ccc66c5c01e24a66..c2f5d6ba1e6b6ba750d5dabe9da591115533ae74 100644 (file)
Binary files a/LayoutTests/svg/W3C-SVG-1.1/painting-marker-02-f-expected.png and b/LayoutTests/svg/W3C-SVG-1.1/painting-marker-02-f-expected.png differ
index 5d3ca79187e151af69510e741f2f26eae1dfe015..3e3c2cd3ff023bd9dd3090725e0078cd5594900c 100644 (file)
@@ -6,8 +6,8 @@ layer at (0,0) size 800x600
   RenderView at (0,0) size 800x600
     KCanvasContainer {svg} at (0,0) size 334.17x150.83
       KCanvasContainer {defs} at (0,0) size 0x0
-      KCanvasContainer {marker} at (0,0) size 16.67x16.67
-        KCanvasItem {rect} at (0,0) size 16.67x16.67 [fill={[type=SOLID] [color=#FF0000]}] [data="M0.00,0.00L10.00,0.00L10.00,10.00L0.00,10.00"]
+      KCanvasContainer {marker} at (0,0) size 3.33x3.33
+        KCanvasItem {rect} at (0,0) size 3.33x3.33 [fill={[type=SOLID] [color=#FF0000]}] [data="M0.00,0.00L10.00,0.00L10.00,10.00L0.00,10.00"]
       RenderSVGText {text} at (0,0) size 800x18
         RenderText {#text} at (0,0) size 294x18
           text run at (0,0) width 294: "The rect should be opaque green, black stroke,"
index af3b54a1e07716dc934344aa01202e1f73c638f6..16927adaca4d06cc565d751a13b22769af04945d 100644 (file)
@@ -1,3 +1,17 @@
+2006-09-20  Rob Buis  <buis@kde.org>
+
+        Reviewed by eseidel.
+
+        http://bugzilla.opendarwin.org/show_bug.cgi?id=10946
+        new marker code draws end-marker in wrong place
+
+        Keep track of the start of the subpath so we can handle
+        closeTo/moveTo correctly.
+
+        * kcanvas/RenderPath.cpp:
+        (WebCore::DrawMarkersData::DrawMarkersData):
+        (WebCore::updateMarkerDataForElement):
+
 2006-09-21  David Hyatt <hyatt@apple.com>
 
         Wheel scrolling prep for Win32.
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();
     }
 }