mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 06:43:32 +00:00
Bug 729850. CG: Get the point order correct when transforming a path. r=mwoodrow
This commit is contained in:
parent
64aa64da5f
commit
3f0b3ef8d7
@ -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;
|
||||
}
|
||||
|
@ -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
|
||||
|
19
layout/reftests/canvas/transformed-path-ref.html
Normal file
19
layout/reftests/canvas/transformed-path-ref.html
Normal 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>
|
21
layout/reftests/canvas/transformed-path.html
Normal file
21
layout/reftests/canvas/transformed-path.html
Normal 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>
|
Loading…
Reference in New Issue
Block a user