Index: sky/examples/style/hex-layout.sky |
diff --git a/sky/examples/style/hex-layout.sky b/sky/examples/style/hex-layout.sky |
index ac2acaf35ed0d44d6717d224cc72ff2385b48edc..695c2dd4029c797cca552a20e7d6f167f4e3b007 100644 |
--- a/sky/examples/style/hex-layout.sky |
+++ b/sky/examples/style/hex-layout.sky |
@@ -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; |