Specs: Simplify the paint model. Now you are not responsible for
actually telling your child to paint, you just say where it would paint. The platform then takes care of making sure all the dirty nodes have their paint() methods called. Review URL: https://codereview.chromium.org/744843003
This commit is contained in:
parent
edcbad7686
commit
eedc2410f2
@ -69,7 +69,6 @@
|
||||
let loop = children.next();
|
||||
while (!loop.done) {
|
||||
let child = loop.value;
|
||||
if (child.needsPaint || child.descendantNeedsPaint) {
|
||||
canvas.save();
|
||||
try {
|
||||
canvas.beginPath();
|
||||
@ -81,11 +80,10 @@
|
||||
canvas.moveTo(child.x, child.y + 3*cellDim/4);
|
||||
canvas.closePath();
|
||||
canvas.clip();
|
||||
this.paintChild(child);
|
||||
canvas.paintChild(child);
|
||||
} finally {
|
||||
canvas.restore();
|
||||
}
|
||||
}
|
||||
loop = children.next();
|
||||
}
|
||||
}
|
||||
|
@ -188,9 +188,9 @@ SKY MODULE
|
||||
let children = this.walkChildren();
|
||||
let loop = children.next();
|
||||
while ((!loop.done) && (loop.value != this.firstSkippedChild))
|
||||
this.paintChild(loop.value, canvas);
|
||||
canvas.paintChild(loop.value);
|
||||
if (this.showingOverflow)
|
||||
this.paintChild(this.overflowChild, canvas);
|
||||
canvas.paintChild(this.overflowChild);
|
||||
}
|
||||
function inChild(child, x, y) {
|
||||
return (x >= child.x) && (y >= child.y) && (x < child.x+child.width) && (y < child.y+child.height);
|
||||
|
Loading…
x
Reference in New Issue
Block a user