]> git.sur5r.net Git - i3/i3/commit
For resizing, convert pixel diff to percentage, based on parent. 3511/head
authoraksel <aksel@akseltorgard.com>
Wed, 7 Nov 2018 21:49:04 +0000 (22:49 +0100)
committeraksel <aksel@akseltorgard.com>
Thu, 8 Nov 2018 22:15:23 +0000 (23:15 +0100)
commitbbfa140c0fc7c3fbf80619f0c97a4cce50517d27
treea26e0c1b1ce6e14bf96f3eb1a307ca16e5b54aff
parent44e8fddc28f36ea0fd15104752e004713118ba5b
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).
include/con.h
include/resize.h
src/commands.c
src/con.c
src/render.c
src/resize.c