Commit 8d2b5c3b authored by Hixie's avatar Hixie

Specs: make sure all layout/paint/hitTest APIs are relative to the right coordinate space

Review URL: https://codereview.chromium.org/725203007
parent 13163261
......@@ -96,12 +96,13 @@
canvas.save();
try {
canvas.beginPath();
canvas.moveTo(child.x, child.y + cellDim/4);
canvas.lineTo(child.x + cellDim/2, child.y);
canvas.lineTo(child.x + cellDim, child.y + cellDim/4);
canvas.lineTo(child.x + cellDim, child.y + 3*cellDim/4);
canvas.lineTo(child.x + cellDim/2, child.y + cellDim);
canvas.moveTo(child.x, child.y + 3*cellDim/4);
canvas.translate(child.x, child.y);
canvas.moveTo(0, cellDim/4);
canvas.lineTo(cellDim/2, 0);
canvas.lineTo(cellDim, cellDim/4);
canvas.lineTo(cellDim, 3*cellDim/4);
canvas.lineTo(cellDim/2, cellDim);
canvas.moveTo(0, 3*cellDim/4);
canvas.closePath();
canvas.clip();
child.paint(canvas);
......@@ -133,7 +134,7 @@
while (!loop.done) {
let child = loop.value;
if (this.inHex(child.x, child.y, child.width, child.height, x, y))
return child.layoutManager.hitText(x, y);
return child.layoutManager.hitTest(x-child.x, y-child.y);
loop = children.next();
}
return this.node;
......
......@@ -195,7 +195,8 @@ SKY MODULE
canvas.save();
try {
canvas.beginPath();
canvas.rect(child.x, child.y, child.width, child.height);
canvas.translate(child.x, child.y);
canvas.rect(0, 0, child.width, child.height);
canvas.clip();
child.paint(canvas);
} finally {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment