HorizontalBox.js 331 B

1234567891011121314
  1. import {DisplayElement} from 'tui-lib/ui/primitives'
  2. export default class HorizontalBox extends DisplayElement {
  3. // A box that will automatically lay out its children in a horizontal row.
  4. fixLayout() {
  5. let nextX = 0
  6. for (const child of this.children) {
  7. child.x = nextX
  8. nextX = child.right + 1
  9. }
  10. }
  11. }