For resizing, convert pixel diff to percentage, based on parent.
Previously, it first calculated one of the containers' next percentage, and then subtracted the previous percentage to find the actual change. Now it directly calculates the change, and subtracts and adds the change to the two affected containers. Added util function con_rect_size_in_orientation. Removed px_resize_to_percent; inlined, using con_rect_size_in_orientation. Also, prematurely return when pixel diff is 0, as no action is necessary. This is related to [this issue on i3-gaps](https://github.com/Airblader/i3/issues/247).
This commit is contained in:
@ -31,9 +31,3 @@ bool resize_neighboring_cons(Con *first, Con *second, int px, int ppt);
|
||||
*
|
||||
*/
|
||||
double percent_for_1px(Con *con);
|
||||
|
||||
/**
|
||||
* Calculate the given container's new percent given a change in pixels.
|
||||
*
|
||||
*/
|
||||
double px_resize_to_percent(Con *con, int px_diff);
|
||||
|
Reference in New Issue
Block a user