Skip to content

Commit

Permalink
Add experimental support for leftToRight & bottomUp
Browse files Browse the repository at this point in the history
  • Loading branch information
tomalec committed Jul 16, 2015
1 parent cb29c24 commit 95ac667
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/juicy-tile-grid.html
Original file line number Diff line number Diff line change
Expand Up @@ -459,21 +459,25 @@
offsetX = offsetY = 0;

}
var ilen = node.items.length;
var ilen = node.items.length,
item, x, y;
while(ilen--){
var item = node.items[ilen];
if(item.hidden){
continue;
}
x = node.leftToRight ? node.width - item.width - item.x : item.x
x += offsetX;
y = node.bottomUp ? node.height - item.height - item.y : item.y
y += offsetY;
drawGridLine(columnAxes, x, item);
drawGridLine(columnAxes, x + item.width, undefined, item, node.gutter);

drawGridLine(columnAxes, offsetX + item.x, item);
drawGridLine(columnAxes, offsetX + item.x + item.width, undefined, item, node.gutter);

drawGridLine(rowAxes, offsetY + item.y, item);
drawGridLine(rowAxes, offsetY + item.y + item.height, undefined, item, node.gutter);
drawGridLine(rowAxes, y, item);
drawGridLine(rowAxes, y + item.height, undefined, item, node.gutter);

if(item.items){
drawGridLinesFromTree( item, offsetX + item.x, offsetY + item.y, columnAxes, rowAxes);
drawGridLinesFromTree( item, x, y, columnAxes, rowAxes);
}
}
// IDEA (tomalec): consider making it on-demand, so grid may auto-center/auto grow if last track is empty
Expand Down

0 comments on commit 95ac667

Please sign in to comment.