-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Fix layout calculations #414
Conversation
This brings consistency into the algorithm (instead of resetting and then fetching again).
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.1.0) | |||
|
|||
project(sway C) | |||
|
|||
set(CMAKE_C_FLAGS "-g") | |||
set(CMAKE_C_FLAGS "-g -lm") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is required by math.h
, if this is not the right way to do this let me know.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think target_link_libraries
is the preferred way to link stuff. And since this is only required by sway this could be moved to sway/CMakeLists.txt
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct, use target_link_libraries in the sway subproject.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super, fixed!
If the width or height of a container can't be evenly distributed to its children, then the layout algorithm still thought it got it right (due to using decimals) which caused a gap of one or more pixels for some window arrangements. This is fixed by this patch by first rounding off the width and height (so that decimals are never introduced) and then adjusting the last view in a container to fill the remaining pixels (which now is counted correctly due to the decimals being removed). Also, due to the way gaps are implemented, an odd sized gap can never be aligned properly, so just adjust to closest even number.
Previous output was confusing.
🎉 |
If the width or height of a container can't be evenly distributed to its
children, then the layout algorithm still thought it got it right (due
to using decimals) which caused a gap of one or more pixels for some
window arrangements.
This is fixed (by the second patch) by first rounding off the width and height
(so that decimals are never introduced) and then adjusting the last
view in a container to fill the remaining pixels (which now is counted
correctly due to the decimals being removed).
Also, due to the way gaps are implemented, an odd sized gap can never be
aligned properly, so just adjust to closest even number.
Fixes #392 .
First patch is a "minor refactoring" of the layout algorithm. Third patch adjusts some debug output that was annoying me.