Advertisement
Guest User

Untitled

a guest
Jan 28th, 2015
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. protected override Size ArrangeOverride(Size finalSize)
  2. {
  3. int row, column;
  4. double x, y, height, width;
  5.  
  6. for (int i = 0; i < this.Children.Count; i++)
  7. {
  8. height = this.Children[i].DesiredSize.Height;
  9. width = COS_30_DEGREE * height;
  10. row = HoneycombPanel.GetRow(this.Children[i]);
  11. column = HoneycombPanel.GetColumn(this.Children[i]);
  12.  
  13. x = row % 2 == 0 ? column * width : (0.5 * width + column * width);
  14. y = 0.75 * row * height;
  15.  
  16. this.Children[i].Arrange(new Rect(new Point(x, y), this.Children[i].DesiredSize));
  17. }
  18.  
  19. return base.ArrangeOverride(finalSize);
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement