mirror of
https://github.com/bevyengine/bevy
synced 2024-09-20 06:22:01 +00:00
don't use padding for layout (#14944)
# Objective - Fixes #14792 - Padding is already handled by taffy, don't handle it also on Bevy side ## Solution - Remove extra computation added in https://github.com/bevyengine/bevy/pull/14777
This commit is contained in:
parent
9cdb915809
commit
e63d7c340f
1 changed files with 4 additions and 10 deletions
|
@ -264,16 +264,10 @@ pub fn ui_layout_system(
|
|||
let Ok(layout) = ui_surface.get_layout(entity) else {
|
||||
return;
|
||||
};
|
||||
let layout_size = inverse_target_scale_factor
|
||||
* Vec2::new(
|
||||
layout.size.width - layout.padding.left - layout.padding.right,
|
||||
layout.size.height - layout.padding.top - layout.padding.bottom,
|
||||
);
|
||||
let layout_location = inverse_target_scale_factor
|
||||
* Vec2::new(
|
||||
layout.location.x + layout.padding.left,
|
||||
layout.location.y + layout.padding.top,
|
||||
);
|
||||
let layout_size =
|
||||
inverse_target_scale_factor * Vec2::new(layout.size.width, layout.size.height);
|
||||
let layout_location =
|
||||
inverse_target_scale_factor * Vec2::new(layout.location.x, layout.location.y);
|
||||
|
||||
absolute_location += layout_location;
|
||||
|
||||
|
|
Loading…
Reference in a new issue