Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(663)

Side by Side Diff: sky/examples/style/toolbar-layout.sky

Issue 725203007: Specs: make sure all layout/paint/hitTest APIs are relative to the right coordinate space (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « sky/examples/style/hex-layout.sky ('k') | sky/specs/style.md » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 SKY MODULE 1 SKY MODULE
2 <import src="sky:core" as="sky"/> 2 <import src="sky:core" as="sky"/>
3 <script> 3 <script>
4 // display: toolbar; 4 // display: toolbar;
5 // toolbar-spacing: <length> 5 // toolbar-spacing: <length>
6 // display: spring; // remaining space is split equally amongst the springs 6 // display: spring; // remaining space is split equally amongst the springs
7 // children are vertically centered, layout out left-to-right with toolbar-spac ing space between them 7 // children are vertically centered, layout out left-to-right with toolbar-spac ing space between them
8 // last child is hidden by default unless there's not enough room for the other s, then it's shown last, right-aligned 8 // last child is hidden by default unless there's not enough room for the other s, then it's shown last, right-aligned
9 module.exports.SpringLayoutManager = class SpringLayoutManager extends sky.Layo utManager { } 9 module.exports.SpringLayoutManager = class SpringLayoutManager extends sky.Layo utManager { }
10 sky.registerLayoutManager('spring', module.exports.SpringLayoutManager); 10 sky.registerLayoutManager('spring', module.exports.SpringLayoutManager);
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 while ((!loop.done) && (loop.value != this.firstSkippedChild)) 188 while ((!loop.done) && (loop.value != this.firstSkippedChild))
189 this.paintChild(loop.value, canvas); 189 this.paintChild(loop.value, canvas);
190 if (this.showingOverflow) 190 if (this.showingOverflow)
191 this.paintChild(this.overflowChild, canvas); 191 this.paintChild(this.overflowChild, canvas);
192 } 192 }
193 function paintChild(child, canvas) { 193 function paintChild(child, canvas) {
194 if (child.needsPaint) { 194 if (child.needsPaint) {
195 canvas.save(); 195 canvas.save();
196 try { 196 try {
197 canvas.beginPath(); 197 canvas.beginPath();
198 canvas.rect(child.x, child.y, child.width, child.height); 198 canvas.translate(child.x, child.y);
199 canvas.rect(0, 0, child.width, child.height);
199 canvas.clip(); 200 canvas.clip();
200 child.paint(canvas); 201 child.paint(canvas);
201 } finally { 202 } finally {
202 canvas.restore(); 203 canvas.restore();
203 } 204 }
204 } 205 }
205 } 206 }
206 } 207 }
207 sky.registerLayoutManager('toolbar', module.exports.ToolbarLayoutManager); 208 sky.registerLayoutManager('toolbar', module.exports.ToolbarLayoutManager);
208 </script> 209 </script>
OLDNEW
« no previous file with comments | « sky/examples/style/hex-layout.sky ('k') | sky/specs/style.md » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698