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

Incorrect node size when using display flex and image nodes #733

Open
NoahR02 opened this issue Oct 26, 2024 · 0 comments
Open

Incorrect node size when using display flex and image nodes #733

NoahR02 opened this issue Oct 26, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@NoahR02
Copy link

NoahR02 commented Oct 26, 2024

taffy version

The release number or commit hash of the version you're using:
Commit: 02453b2
Note: I went back to commits from almost a year ago and the issue seems present there too, so I don't think this is a regression.

Platform

What platform are you using taffy on? e.g. Rust, Android, IOS, JavaScript/TypeScript
Language: Rust
OS: Windows

What you did

The steps you took to uncover this bug:
I observed the bug happening in my custom gui framework, so I made a small example in html and then made an equivalent taffy version to get a minimally reproducible example.

Please provide a runnable code snippet or link to an example that demonstrates the problem if you can:

HTML:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body {
            margin: 0;
        }
        body, body * {
            display: flex;
        }
      </style>
</head>
<body>
        <div>
            <img src="https://upload.wikimedia.org/wikipedia/commons/thumb/e/e6/Red_Panda_%2824986761703%29.jpg/440px-Red_Panda_%2824986761703%29.jpg" />
        </div>
</body>
</html>

Rust:

use taffy::geometry::Size;

pub struct ImageContext {
    pub width: f32,
    pub height: f32,
}

pub fn image_measure_function(
    known_dimensions: taffy::geometry::Size<Option<f32>>,
    image_context: &ImageContext,
) -> taffy::geometry::Size<f32> {
    match (known_dimensions.width, known_dimensions.height) {
        (Some(width), Some(height)) => Size { width, height },
        (Some(width), None) => Size { width, height: (width / image_context.width) * image_context.height },
        (None, Some(height)) => Size { width: (height / image_context.height) * image_context.width, height },
        (None, None) => Size { width: image_context.width, height: image_context.height },
    }
}
use taffy::prelude::*;

enum NodeContext {
    Image(ImageContext),
}

fn measure_function(
    known_dimensions: taffy::geometry::Size<Option<f32>>,
    available_space: taffy::geometry::Size<taffy::style::AvailableSpace>,
    node_context: Option<&mut NodeContext>,
) -> Size<f32> {
    if let Size { width: Some(width), height: Some(height) } = known_dimensions {
        return Size { width, height };
    }

    match node_context {
        None => Size::ZERO,
        Some(NodeContext::Image(image_context)) => image_measure_function(known_dimensions, image_context),
    }
}

fn main() -> Result<(), taffy::TaffyError> {
    let mut taffy: TaffyTree<NodeContext> = TaffyTree::new();

    let image_node = taffy
        .new_leaf_with_context( Style {
            display: Display::Flex,
            ..Default::default()
        }, NodeContext::Image(ImageContext { width: 440.0, height: 291.0 }))?;

    let image_container = taffy.new_with_children(
        Style {
            display: Display::Flex,
            ..Default::default()
        },
        &[image_node],
    )?;

    let body = taffy.new_with_children(
        Style {
            display: Display::Flex,
            ..Default::default()
        },
        &[image_container],
    )?;

    // Compute layout and print result
    taffy.compute_layout_with_measure(
        body,
        Size {
            // Let window size = (1280, 720).
            width: AvailableSpace::Definite(1280.0),
            height: AvailableSpace::Definite(720.0),
        },
        // Note: this closure is a FnMut closure and can be used to borrow external context for the duration of layout
        // For example, you may wish to borrow a global font registry and pass it into your text measuring function
        |known_dimensions, available_space, _node_id, node_context, _style| {
            measure_function(known_dimensions, available_space, node_context)
        },
    )?;
    taffy.print_tree(body);

    Ok(())
}

What went wrong

What were you expecting:

I expect the resulting node sizes in the taffy tree to be close/identical to what the html node sizes listed below are.

# Taffy
TREE
└──  FLEX ROW [x: 0    y: 0    w: 1089 h: 720  content_w: 1089 content_h: 720  border: l:0 r:0 t:0 b:0, padding: l:0 r:0 t:0 b:0] (NodeId(4294967299))
    └──  FLEX ROW [x: 0    y: 0    w: 1089 h: 720  content_w: 1089 content_h: 720  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: 1089 h: 720  content_w: 440  content_h: 291  border: l:0 r:0 t:0 b:0, padding: l:0 r:0 t:0 b:0] (NodeId(4294967297)
      
# html        
 Width: 1280px, Height: 291px // body
     -- Width: 1280px, Height: 291px // div
           -- Width: 440px, Height: 291px // img

Additional information

Other information that can be used to further reproduce or isolate the problem.
This commonly includes:

I observed that max width was ignored as well. If I change the image container to be display block, then the max size is respected, but this may just be a side effect of the bug.

Debug logs when running the above taffy example:

    NodeId(4294967299): 
    NodeId(4294967299): PerformLayout
    NodeId(4294967299): sizing_mode InherentSize
    NodeId(4294967299): known_dimensions Size { width: None, height: None }
    NodeId(4294967299): parent_size Size { width: Some(1280.0), height: Some(720.0) }
    NodeId(4294967299): available_space Size { width: Definite(1280.0), height: Definite(720.0) }
    NodeId(4294967299): FLEX
    NodeId(4294967299): PerformLayout
    NodeId(4294967299): sizing_mode InherentSize
    NodeId(4294967299): known_dimensions Size { width: None, height: None }
    NodeId(4294967299): parent_size Size { width: Some(1280.0), height: Some(720.0) }
    NodeId(4294967299): available_space Size { width: Definite(1280.0), height: Definite(720.0) }
    NodeId(4294967299): FLEX: Row
    NodeId(4294967299): generate_anonymous_flex_items
    NodeId(4294967299): determine_available_space
    NodeId(4294967299): determine_flex_base_size
    NodeId(4294967299): COMPUTE CHILD BASE SIZE:
        NodeId(4294967298):
        NodeId(4294967298): ComputeSize
        NodeId(4294967298): sizing_mode ContentSize
        NodeId(4294967298): known_dimensions Size { width: None, height: Some(720.0) }
        NodeId(4294967298): parent_size Size { width: None, height: None }
        NodeId(4294967298): available_space Size { width: MaxContent, height: Definite(720.0) }
        NodeId(4294967298): FLEX
        NodeId(4294967298): ComputeSize
        NodeId(4294967298): sizing_mode ContentSize
        NodeId(4294967298): known_dimensions Size { width: None, height: Some(720.0) }
        NodeId(4294967298): parent_size Size { width: None, height: None }
        NodeId(4294967298): available_space Size { width: MaxContent, height: Definite(720.0) }
        NodeId(4294967298): FLEX: Row
        NodeId(4294967298): generate_anonymous_flex_items
        NodeId(4294967298): determine_available_space
        NodeId(4294967298): determine_flex_base_size
        NodeId(4294967298): COMPUTE CHILD BASE SIZE:
            NodeId(4294967297):
            NodeId(4294967297): ComputeSize
            NodeId(4294967297): sizing_mode ContentSize
            NodeId(4294967297): known_dimensions Size { width: None, height: Some(720.0) }
            NodeId(4294967297): parent_size Size { width: None, height: Some(720.0) }
            NodeId(4294967297): available_space Size { width: MaxContent, height: Definite(720.0) }
            NodeId(4294967297): FLEX
            NodeId(4294967297): ComputeSize
            NodeId(4294967297): sizing_mode ContentSize
            NodeId(4294967297): known_dimensions Size { width: None, height: Some(720.0) }
            NodeId(4294967297): parent_size Size { width: None, height: Some(720.0) }
            NodeId(4294967297): available_space Size { width: MaxContent, height: Definite(720.0) }
            NodeId(4294967297): LEAF
            NodeId(4294967297): node_size Size { width: None, height: Some(720.0) }
            NodeId(4294967297): min_size  Size { width: None, height: None }
            NodeId(4294967297): max_size  Size { width: None, height: None }
            NodeId(4294967297): RESULT Size { width: 1088.6598, height: 720.0 }
        NodeId(4294967298): COMPUTE CHILD MIN SIZE:
            NodeId(4294967297):
            NodeId(4294967297): ComputeSize
            NodeId(4294967297): sizing_mode ContentSize
            NodeId(4294967297): known_dimensions Size { width: None, height: Some(720.0) }
            NodeId(4294967297): parent_size Size { width: None, height: Some(720.0) }
            NodeId(4294967297): available_space Size { width: MinContent, height: Definite(720.0) }
            NodeId(4294967297): FLEX
            NodeId(4294967297): ComputeSize
            NodeId(4294967297): sizing_mode ContentSize
            NodeId(4294967297): known_dimensions Size { width: None, height: Some(720.0) }
            NodeId(4294967297): parent_size Size { width: None, height: Some(720.0) }
            NodeId(4294967297): available_space Size { width: MinContent, height: Definite(720.0) }
            NodeId(4294967297): LEAF
            NodeId(4294967297): node_size Size { width: None, height: Some(720.0) }
            NodeId(4294967297): min_size  Size { width: None, height: None }
            NodeId(4294967297): max_size  Size { width: None, height: None }
            NodeId(4294967297): RESULT Size { width: 1088.6598, height: 720.0 }
        NodeId(4294967298): item.flex_basis 1088.6598
        NodeId(4294967298): item.inner_flex_basis 1088.6598
        NodeId(4294967298): item.hypothetical_outer_size Size { width: 1088.6598, height: 0.0 }
        NodeId(4294967298): item.hypothetical_inner_size Size { width: 1088.6598, height: 0.0 }
        NodeId(4294967298): item.resolved_minimum_main_size 1088.6598
        NodeId(4294967298): collect_flex_lines
        NodeId(4294967298): determine_container_main_size
        NodeId(4294967298): constants.node_outer_size Size { width: Some(1088.6598), height: Some(720.0) }
        NodeId(4294967298): constants.node_inner_size Size { width: Some(1088.6598), height: Some(720.0) }
        NodeId(4294967298): resolve_flexible_lengths
        NodeId(4294967298): determine_hypothetical_cross_size
            NodeId(4294967297):
            NodeId(4294967297): ComputeSize
            NodeId(4294967297): sizing_mode ContentSize
            NodeId(4294967297): known_dimensions Size { width: Some(1088.6598), height: None }
            NodeId(4294967297): parent_size Size { width: Some(1088.6598), height: Some(720.0) }
            NodeId(4294967297): available_space Size { width: Definite(1088.6598), height: Definite(720.0) }
            NodeId(4294967297): FLEX
            NodeId(4294967297): ComputeSize
            NodeId(4294967297): sizing_mode ContentSize
            NodeId(4294967297): known_dimensions Size { width: Some(1088.6598), height: None }
            NodeId(4294967297): parent_size Size { width: Some(1088.6598), height: Some(720.0) }
            NodeId(4294967297): available_space Size { width: Definite(1088.6598), height: Definite(720.0) }
            NodeId(4294967297): LEAF
            NodeId(4294967297): node_size Size { width: Some(1088.6598), height: None }
            NodeId(4294967297): min_size  Size { width: None, height: None }
            NodeId(4294967297): max_size  Size { width: None, height: None }
            NodeId(4294967297): RESULT Size { width: 1088.6598, height: 720.0 }
        NodeId(4294967298): calculate_children_base_lines
        NodeId(4294967298): calculate_cross_size
        NodeId(4294967298): handle_align_content_stretch
        NodeId(4294967298): determine_used_cross_size
        NodeId(4294967298): distribute_remaining_free_space
        NodeId(4294967298): resolve_cross_axis_auto_margins
        NodeId(4294967298): determine_container_cross_size
        NodeId(4294967298): RESULT Size { width: 1088.6598, height: 720.0 }
    NodeId(4294967299): COMPUTE CHILD MIN SIZE:
        NodeId(4294967298):
        NodeId(4294967298): ComputeSize
        NodeId(4294967298): sizing_mode ContentSize
        NodeId(4294967298): known_dimensions Size { width: None, height: Some(720.0) }
        NodeId(4294967298): parent_size Size { width: None, height: None }
        NodeId(4294967298): available_space Size { width: MinContent, height: Definite(720.0) }
        NodeId(4294967298): FLEX
        NodeId(4294967298): ComputeSize
        NodeId(4294967298): sizing_mode ContentSize
        NodeId(4294967298): known_dimensions Size { width: None, height: Some(720.0) }
        NodeId(4294967298): parent_size Size { width: None, height: None }
        NodeId(4294967298): available_space Size { width: MinContent, height: Definite(720.0) }
        NodeId(4294967298): FLEX: Row
        NodeId(4294967298): generate_anonymous_flex_items
        NodeId(4294967298): determine_available_space
        NodeId(4294967298): determine_flex_base_size
        NodeId(4294967298): COMPUTE CHILD BASE SIZE:
            NodeId(4294967297):
            NodeId(4294967297): ComputeSize
            NodeId(4294967297): sizing_mode ContentSize
            NodeId(4294967297): known_dimensions Size { width: None, height: Some(720.0) }
            NodeId(4294967297): parent_size Size { width: None, height: Some(720.0) }
            NodeId(4294967297): available_space Size { width: MinContent, height: Definite(720.0) }
            NodeId(4294967297): RESULT (CACHED) Size { width: 1088.6598, height: 720.0 }
        NodeId(4294967298): COMPUTE CHILD MIN SIZE:
            NodeId(4294967297):
            NodeId(4294967297): ComputeSize
            NodeId(4294967297): sizing_mode ContentSize
            NodeId(4294967297): known_dimensions Size { width: None, height: Some(720.0) }
            NodeId(4294967297): parent_size Size { width: None, height: Some(720.0) }
            NodeId(4294967297): available_space Size { width: MinContent, height: Definite(720.0) }
            NodeId(4294967297): RESULT (CACHED) Size { width: 1088.6598, height: 720.0 }
        NodeId(4294967298): item.flex_basis 1088.6598
        NodeId(4294967298): item.inner_flex_basis 1088.6598
        NodeId(4294967298): item.hypothetical_outer_size Size { width: 1088.6598, height: 0.0 }
        NodeId(4294967298): item.hypothetical_inner_size Size { width: 1088.6598, height: 0.0 }
        NodeId(4294967298): item.resolved_minimum_main_size 1088.6598
        NodeId(4294967298): collect_flex_lines
        NodeId(4294967298): determine_container_main_size
        NodeId(4294967298): constants.node_outer_size Size { width: Some(1088.6598), height: Some(720.0) }
        NodeId(4294967298): constants.node_inner_size Size { width: Some(1088.6598), height: Some(720.0) }
        NodeId(4294967298): resolve_flexible_lengths
        NodeId(4294967298): determine_hypothetical_cross_size
            NodeId(4294967297):
            NodeId(4294967297): ComputeSize
            NodeId(4294967297): sizing_mode ContentSize
            NodeId(4294967297): known_dimensions Size { width: Some(1088.6598), height: None }
            NodeId(4294967297): parent_size Size { width: Some(1088.6598), height: Some(720.0) }
            NodeId(4294967297): available_space Size { width: Definite(1088.6598), height: Definite(720.0) }
            NodeId(4294967297): RESULT (CACHED) Size { width: 1088.6598, height: 720.0 }
        NodeId(4294967298): calculate_children_base_lines
        NodeId(4294967298): calculate_cross_size
        NodeId(4294967298): handle_align_content_stretch
        NodeId(4294967298): determine_used_cross_size
        NodeId(4294967298): distribute_remaining_free_space
        NodeId(4294967298): resolve_cross_axis_auto_margins
        NodeId(4294967298): determine_container_cross_size
        NodeId(4294967298): RESULT Size { width: 1088.6598, height: 720.0 }
    NodeId(4294967299): item.flex_basis 1088.6598
    NodeId(4294967299): item.inner_flex_basis 1088.6598
    NodeId(4294967299): item.hypothetical_outer_size Size { width: 1088.6598, height: 0.0 }
    NodeId(4294967299): item.hypothetical_inner_size Size { width: 1088.6598, height: 0.0 }
    NodeId(4294967299): item.resolved_minimum_main_size 1088.6598
    NodeId(4294967299): collect_flex_lines
    NodeId(4294967299): determine_container_main_size
    NodeId(4294967299): constants.node_outer_size Size { width: Some(1088.6598), height: None }
    NodeId(4294967299): constants.node_inner_size Size { width: Some(1088.6598), height: None }
    NodeId(4294967299): resolve_flexible_lengths
    NodeId(4294967299): determine_hypothetical_cross_size
        NodeId(4294967298):
        NodeId(4294967298): ComputeSize
        NodeId(4294967298): sizing_mode ContentSize
        NodeId(4294967298): known_dimensions Size { width: Some(1088.6598), height: None }
        NodeId(4294967298): parent_size Size { width: Some(1088.6598), height: None }
        NodeId(4294967298): available_space Size { width: Definite(1088.6598), height: Definite(720.0) }
        NodeId(4294967298): FLEX
        NodeId(4294967298): ComputeSize
        NodeId(4294967298): sizing_mode ContentSize
        NodeId(4294967298): known_dimensions Size { width: Some(1088.6598), height: None }
        NodeId(4294967298): parent_size Size { width: Some(1088.6598), height: None }
        NodeId(4294967298): available_space Size { width: Definite(1088.6598), height: Definite(720.0) }
        NodeId(4294967298): FLEX: Row
        NodeId(4294967298): generate_anonymous_flex_items
        NodeId(4294967298): determine_available_space
        NodeId(4294967298): determine_flex_base_size
        NodeId(4294967298): COMPUTE CHILD BASE SIZE:
            NodeId(4294967297):
            NodeId(4294967297): ComputeSize
            NodeId(4294967297): sizing_mode ContentSize
            NodeId(4294967297): known_dimensions Size { width: None, height: Some(720.0) }
            NodeId(4294967297): parent_size Size { width: None, height: None }
            NodeId(4294967297): available_space Size { width: MaxContent, height: Definite(720.0) }
            NodeId(4294967297): RESULT (CACHED) Size { width: 1088.6598, height: 720.0 }
        NodeId(4294967298): COMPUTE CHILD MIN SIZE:
            NodeId(4294967297):
            NodeId(4294967297): ComputeSize
            NodeId(4294967297): sizing_mode ContentSize
            NodeId(4294967297): known_dimensions Size { width: None, height: Some(720.0) }
            NodeId(4294967297): parent_size Size { width: None, height: None }
            NodeId(4294967297): available_space Size { width: MinContent, height: Definite(720.0) }
            NodeId(4294967297): RESULT (CACHED) Size { width: 1088.6598, height: 720.0 }
        NodeId(4294967298): item.flex_basis 1088.6598
        NodeId(4294967298): item.inner_flex_basis 1088.6598
        NodeId(4294967298): item.hypothetical_outer_size Size { width: 1088.6598, height: 0.0 }
        NodeId(4294967298): item.hypothetical_inner_size Size { width: 1088.6598, height: 0.0 }
        NodeId(4294967298): item.resolved_minimum_main_size 1088.6598
        NodeId(4294967298): collect_flex_lines
        NodeId(4294967298): determine_container_main_size
        NodeId(4294967298): resolve_flexible_lengths
        NodeId(4294967298): determine_hypothetical_cross_size
            NodeId(4294967297):
            NodeId(4294967297): ComputeSize
            NodeId(4294967297): sizing_mode ContentSize
            NodeId(4294967297): known_dimensions Size { width: Some(1088.6598), height: None }
            NodeId(4294967297): parent_size Size { width: Some(1088.6598), height: None }
            NodeId(4294967297): available_space Size { width: Definite(1088.6598), height: Definite(720.0) }
            NodeId(4294967297): RESULT (CACHED) Size { width: 1088.6598, height: 720.0 }
        NodeId(4294967298): calculate_children_base_lines
        NodeId(4294967298): calculate_cross_size
        NodeId(4294967298): handle_align_content_stretch
        NodeId(4294967298): determine_used_cross_size
        NodeId(4294967298): distribute_remaining_free_space
        NodeId(4294967298): resolve_cross_axis_auto_margins
        NodeId(4294967298): determine_container_cross_size
        NodeId(4294967298): RESULT Size { width: 1088.6598, height: 720.0 }
    NodeId(4294967299): calculate_children_base_lines
    NodeId(4294967299): calculate_cross_size
    NodeId(4294967299): handle_align_content_stretch
    NodeId(4294967299): determine_used_cross_size
    NodeId(4294967299): distribute_remaining_free_space
    NodeId(4294967299): resolve_cross_axis_auto_margins
    NodeId(4294967299): determine_container_cross_size
    NodeId(4294967299): align_flex_lines_per_align_content
    NodeId(4294967299): final_layout_pass
        NodeId(4294967298):
        NodeId(4294967298): PerformLayout
        NodeId(4294967298): sizing_mode ContentSize
        NodeId(4294967298): known_dimensions Size { width: Some(1088.6598), height: Some(720.0) }
        NodeId(4294967298): parent_size Size { width: Some(1088.6598), height: None }
        NodeId(4294967298): available_space Size { width: Definite(1088.6598), height: Definite(720.0) }
        NodeId(4294967298): FLEX
        NodeId(4294967298): PerformLayout
        NodeId(4294967298): sizing_mode ContentSize
        NodeId(4294967298): known_dimensions Size { width: Some(1088.6598), height: Some(720.0) }
        NodeId(4294967298): parent_size Size { width: Some(1088.6598), height: None }
        NodeId(4294967298): available_space Size { width: Definite(1088.6598), height: Definite(720.0) }
        NodeId(4294967298): FLEX: Row
        NodeId(4294967298): generate_anonymous_flex_items
        NodeId(4294967298): determine_available_space
        NodeId(4294967298): determine_flex_base_size
        NodeId(4294967298): COMPUTE CHILD BASE SIZE:
            NodeId(4294967297):
            NodeId(4294967297): ComputeSize
            NodeId(4294967297): sizing_mode ContentSize
            NodeId(4294967297): known_dimensions Size { width: None, height: Some(720.0) }
            NodeId(4294967297): parent_size Size { width: None, height: Some(720.0) }
            NodeId(4294967297): available_space Size { width: MaxContent, height: Definite(720.0) }
            NodeId(4294967297): RESULT (CACHED) Size { width: 1088.6598, height: 720.0 }
        NodeId(4294967298): COMPUTE CHILD MIN SIZE:
            NodeId(4294967297):
            NodeId(4294967297): ComputeSize
            NodeId(4294967297): sizing_mode ContentSize
            NodeId(4294967297): known_dimensions Size { width: None, height: Some(720.0) }
            NodeId(4294967297): parent_size Size { width: None, height: Some(720.0) }
            NodeId(4294967297): available_space Size { width: MinContent, height: Definite(720.0) }
            NodeId(4294967297): RESULT (CACHED) Size { width: 1088.6598, height: 720.0 }
        NodeId(4294967298): item.flex_basis 1088.6598
        NodeId(4294967298): item.inner_flex_basis 1088.6598
        NodeId(4294967298): item.hypothetical_outer_size Size { width: 1088.6598, height: 0.0 }
        NodeId(4294967298): item.hypothetical_inner_size Size { width: 1088.6598, height: 0.0 }
        NodeId(4294967298): item.resolved_minimum_main_size 1088.6598
        NodeId(4294967298): collect_flex_lines
        NodeId(4294967298): determine_container_main_size
        NodeId(4294967298): resolve_flexible_lengths
        NodeId(4294967298): determine_hypothetical_cross_size
            NodeId(4294967297):
            NodeId(4294967297): ComputeSize
            NodeId(4294967297): sizing_mode ContentSize
            NodeId(4294967297): known_dimensions Size { width: Some(1088.6598), height: None }
            NodeId(4294967297): parent_size Size { width: Some(1088.6598), height: Some(720.0) }
            NodeId(4294967297): available_space Size { width: Definite(1088.6598), height: Definite(720.0) }
            NodeId(4294967297): RESULT (CACHED) Size { width: 1088.6598, height: 720.0 }
        NodeId(4294967298): calculate_children_base_lines
        NodeId(4294967298): calculate_cross_size
        NodeId(4294967298): handle_align_content_stretch
        NodeId(4294967298): determine_used_cross_size
        NodeId(4294967298): distribute_remaining_free_space
        NodeId(4294967298): resolve_cross_axis_auto_margins
        NodeId(4294967298): determine_container_cross_size
        NodeId(4294967298): align_flex_lines_per_align_content
        NodeId(4294967298): final_layout_pass
            NodeId(4294967297):
            NodeId(4294967297): PerformLayout
            NodeId(4294967297): sizing_mode ContentSize
            NodeId(4294967297): known_dimensions Size { width: Some(1088.6598), height: Some(720.0) }
            NodeId(4294967297): parent_size Size { width: Some(1088.6598), height: Some(720.0) }
            NodeId(4294967297): available_space Size { width: Definite(1088.6598), height: Definite(720.0) }
            NodeId(4294967297): FLEX
            NodeId(4294967297): PerformLayout
            NodeId(4294967297): sizing_mode ContentSize
            NodeId(4294967297): known_dimensions Size { width: Some(1088.6598), height: Some(720.0) }
            NodeId(4294967297): parent_size Size { width: Some(1088.6598), height: Some(720.0) }
            NodeId(4294967297): available_space Size { width: Definite(1088.6598), height: Definite(720.0) }
            NodeId(4294967297): LEAF
            NodeId(4294967297): node_size Size { width: Some(1088.6598), height: Some(720.0) }
            NodeId(4294967297): min_size  Size { width: None, height: None }
            NodeId(4294967297): max_size  Size { width: None, height: None }
            NodeId(4294967297): RESULT Size { width: 1088.6598, height: 720.0 }
        NodeId(4294967298): perform_absolute_layout_on_absolute_children
        NodeId(4294967298): hidden_layout
        NodeId(4294967298): RESULT Size { width: 1088.6598, height: 720.0 }
    NodeId(4294967299): perform_absolute_layout_on_absolute_children
    NodeId(4294967299): hidden_layout
    NodeId(4294967299): RESULT Size { width: 1088.6598, height: 720.0 }
TREE
└──  FLEX ROW [x: 0    y: 0    w: 1089 h: 720  content_w: 1089 content_h: 720  border: l:0 r:0 t:0 b:0, padding: l:0 r:0 t:0 b:0] (NodeId(4294967299))
    └──  FLEX ROW [x: 0    y: 0    w: 1089 h: 720  content_w: 1089 content_h: 720  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: 1089 h: 720  content_w: 440  content_h: 291  border: l:0 r:0 t:0 b:0, padding: l:0 r:0 t:0 b:0] (NodeId(4294967297))

Images from my gui:

image

Shrinking the window height here:
image

The below image shows an overflow, but the max width here is 1.0 / 100%:
image

@NoahR02 NoahR02 added the bug Something isn't working label Oct 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant