Bug 729850. CG: Get the point order correct when transforming a path. r=mwoodrow

This commit is contained in:
Jeff Muizelaar 2012-02-25 00:35:41 -05:00
parent 64aa64da5f
commit 3f0b3ef8d7
4 changed files with 46 additions and 5 deletions

View File

@ -160,16 +160,16 @@ PathCG::TransformedCopyToBuilder(const Matrix &aTransform, FillRule aFillRule) c
}
case kCGPathElementAddQuadCurveToPoint:
{
CGPoint pt = element->points[0];
CGPoint cpt = element->points[1];
CGPoint cpt = element->points[0];
CGPoint pt = element->points[1];
CGPathAddQuadCurveToPoint(info->path, &info->transform, cpt.x, cpt.y, pt.x, pt.y);
break;
}
case kCGPathElementAddCurveToPoint:
{
CGPoint pt = element->points[0];
CGPoint cpt1 = element->points[1];
CGPoint cpt2 = element->points[2];
CGPoint cpt1 = element->points[0];
CGPoint cpt2 = element->points[1];
CGPoint pt = element->points[2];
CGPathAddCurveToPoint(info->path, &info->transform, cpt1.x, cpt1.y, cpt2.x, cpt2.y, pt.x, pt.y);
break;
}

View File

@ -79,3 +79,4 @@ fails-if(/Mac\x20OS\x20X\x2010\.[56]/.test(http.oscpu)) == 672646-alpha-radial-g
== transformed-clip.html transformed-clip-ref.html
== transformed-gradient.html transformed-gradient-ref.html
== transformed-path.html transformed-path.html

View File

@ -0,0 +1,19 @@
<html>
<body>
<canvas width="500" height="500"></canvas>
<script>
var canvas = document.getElementsByTagName('canvas')[0];
var ctx = canvas.getContext('2d');
ctx.scale(0.5, 0.5);
ctx.translate(41, 41.);
ctx.rect(0, 0, 100, 100);
ctx.moveTo(100,0);
ctx.quadraticCurveTo(200, 100, 300,0);
ctx.moveTo(300,0);
ctx.bezierCurveTo(400, 100, 500, -100, 600,0);
ctx.stroke();
</script>
</body>
</html>

View File

@ -0,0 +1,21 @@
<html>
<body>
<canvas width="500" height="500"></canvas>
<script>
var canvas = document.getElementsByTagName('canvas')[0];
var ctx = canvas.getContext('2d');
ctx.scale(0.5, 0.5);
ctx.translate(41, 41.);
ctx.rect(0, 0, 100, 100);
ctx.translate(100, 0);
ctx.moveTo(0,0);
ctx.quadraticCurveTo(100, 100, 200,0);
ctx.translate(200, 0);
ctx.moveTo(0,0);
ctx.bezierCurveTo(100, 100, 200, -100, 300,0);
ctx.stroke();
</script>
</body>
</html>