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

Scroll widgets: Remove fix where the containing block's height was no… #321

Merged
merged 1 commit into from
May 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions Source/Core/Elements/WidgetSlider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,10 +250,9 @@ void WidgetSlider::FormatElements(const Vector2f containing_block, float slider_
{
int length_axis = orientation == VERTICAL ? 1 : 0;

// Build the box for the containing slider element. As the containing block is not guaranteed to have a defined
// height, we must use the width for both axes.
// Build the box for the containing slider element.
Box parent_box;
ElementUtilities::BuildBox(parent_box, Vector2f(containing_block.x, containing_block.x), parent);
ElementUtilities::BuildBox(parent_box, containing_block, parent);

// Set the length of the slider.
Vector2f content = parent_box.GetSize();
Expand Down
5 changes: 2 additions & 3 deletions Source/Core/WidgetScroll.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,10 +215,9 @@ void WidgetScroll::FormatElements(const Vector2f containing_block, bool resize_e
{
int length_axis = orientation == VERTICAL ? 1 : 0;

// Build the box for the containing slider element. As the containing block is not guaranteed to have a defined
// height, we must use the width for both axes.
// Build the box for the containing slider element.
Box parent_box;
LayoutDetails::BuildBox(parent_box, Vector2f(containing_block.x, containing_block.x), parent);
LayoutDetails::BuildBox(parent_box, containing_block, parent);
slider_length -= orientation == VERTICAL ? (parent_box.GetCumulativeEdge(Box::CONTENT, Box::TOP) + parent_box.GetCumulativeEdge(Box::CONTENT, Box::BOTTOM)) :
(parent_box.GetCumulativeEdge(Box::CONTENT, Box::LEFT) + parent_box.GetCumulativeEdge(Box::CONTENT, Box::RIGHT));

Expand Down