Specs: make sure all layout/paint/hitTest APIs are relative to the right coordinate space
Review URL: https://codereview.chromium.org/725203007
This commit is contained in:
parent
1316326183
commit
8d2b5c3b1d
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user