Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed print_tree() when rounding is disabled #680

Merged
merged 1 commit into from
Jul 11, 2024

Conversation

spirali
Copy link
Contributor

@spirali spirali commented Jul 10, 2024

Objective

Fixes .print_tree() method when rounding is disabled. In the original version, if rounding is disabled, .print_tree() just prints zeros.

Original version if rounding is enabled prints:

TREE
└──  FLEX COL [x: 0    y: 0    w: 800  h: 600  content_w: 600  content_h: 300  border: l:0 r:0 t:0 b:0, padding: l:0 r:0 t:0 b:0] (NodeId(4294967299))
    └──  GRID [x: 0    y: 0    w: 600  h: 300  content_w: 300  content_h: 300  border: l:0 r:0 t:0 b:0, padding: l:0 r:0 t:0 b:0] (NodeId(4294967298))
        └──  LEAF [x: 100  y: 150  w: 200  h: 150  content_w: 0    content_h: 0    border: l:0 r:0 t:0 b:0, padding: l:0 r:0 t:0 b:0] (NodeId(4294967297))

Original version if rounding is disabled prints:

TREE
└──  FLEX COL [x: 0    y: 0    w: 0    h: 0    content_w: 0    content_h: 0    border: l:0 r:0 t:0 b:0, padding: l:0 r:0 t:0 b:0] (NodeId(4294967299))
    └──  GRID [x: 0    y: 0    w: 0    h: 0    content_w: 0    content_h: 0    border: l:0 r:0 t:0 b:0, padding: l:0 r:0 t:0 b:0] (NodeId(4294967298))
        └──  LEAF [x: 0    y: 0    w: 0    h: 0    content_w: 0    content_h: 0    border: l:0 r:0 t:0 b:0, padding: l:0 r:0 t:0 b:0] (NodeId(4294967297))

This change prints the first output even rounding is disabled.

@nicoburns nicoburns merged commit 8512b90 into DioxusLabs:main Jul 11, 2024
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants