http://bugzilla.opendarwin.org/show_bug.cgi?id=6546
clipPath data does not respect transforms
Get the transform from the dom element and adjust
the clip path with it.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@16212
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2006-09-04 Rob Buis <buis@kde.org>
+
+ Reviewed by Eric.
+
+ Testcase needed for:
+ http://bugzilla.opendarwin.org/show_bug.cgi?id=6546
+ clipPath data does not respect transforms
+
+ * svg/custom/clip-path-with-transform-expected.checksum: Added.
+ * svg/custom/clip-path-with-transform-expected.png: Added.
+ * svg/custom/clip-path-with-transform-expected.txt: Added.
+ * svg/custom/clip-path-with-transform.svg: Added.
+
2006-09-03 Alexey Proskuryakov <ap@nypop.com>
Reviewed by Tim H.
--- /dev/null
+16310588467cfc20d551635abc59b784
\ No newline at end of file
--- /dev/null
+KCanvasResource {id="myclip" [type=CLIPPER] [clip data=[[winding=NON-ZERO] [path=M0.00,0.00L100.00,0.00L100.00,100.00L0.00,100.00]]]}
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+ KCanvasContainer {svg} at (0,0) size 200x200
+ KCanvasContainer {defs} at (0,0) size 0x0
+ KCanvasContainer {g} at (0,0) size 200x200 [clip path="#myclip"]
+ KCanvasItem {rect} at (0,0) size 200x200 [fill={[type=SOLID] [color=#FF0000]}] [data="M0.00,0.00L200.00,0.00L200.00,200.00L0.00,200.00"]
+ KCanvasItem {rect} at (0,0) size 100x100 [fill={[type=SOLID] [color=#008000]}] [data="M0.00,0.00L100.00,0.00L100.00,100.00L0.00,100.00"]
--- /dev/null
+<?xml version="1.0"?>
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink">
+<defs>
+ <clipPath id="myclip">
+ <path transform="scale(.5)" d="M 0 0 l 200 0 l 0 200 l -200 0 Z"/>
+ </clipPath>
+</defs>
+<g clip-path="url(#myclip)">
+<rect x="0" y="0" width="200" height="200" fill="red"/>
+<rect x="0" y="0" width="100" height="100" fill="green"/>
+</g>
+</svg>
+
+2006-09-04 Rob Buis <buis@kde.org>
+
+ Reviewed by Eric.
+
+ http://bugzilla.opendarwin.org/show_bug.cgi?id=6546
+ clipPath data does not respect transforms
+
+ Get the transform from the dom element and adjust
+ the clip path with it.
+
+ * ksvg2/svg/SVGClipPathElement.cpp:
+ (SVGClipPathElement::canvasResource):
+
2006-09-04 Rob Buis <buis@kde.org>
Reviewed by Eric.
#include "SVGAnimatedEnumeration.h"
#include "SVGHelper.h"
#include "SVGNames.h"
+#include "SVGMatrix.h"
#include "SVGRenderStyle.h"
#include "cssstyleselector.h"
#include "ksvg.h"
SVGStyledElement *styled = static_cast<SVGStyledElement *>(e);
RenderStyle *pathStyle = document()->styleSelector()->styleForElement(styled, clipPathStyle);
Path pathData = styled->toPathData();
+ if (e->isStyledTransformable())
+ pathData.transform(static_cast<SVGStyledTransformableElement *>(e)->localMatrix()->matrix());
if (!pathData.isEmpty())
m_clipper->addClipData(pathData, pathStyle->svgStyle()->clipRule(), bbox);
pathStyle->deref(view()->renderArena());