mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-06-19 14:33:16 -04:00
format code
This commit is contained in:
parent
cf3cd6fe3f
commit
f459876e07
1 changed files with 33 additions and 38 deletions
11
src/mango.c
11
src/mango.c
|
|
@ -3919,25 +3919,20 @@ void resize_tile_client(Client *grabc) {
|
||||||
// 计算相对于屏幕尺寸的比例变化
|
// 计算相对于屏幕尺寸的比例变化
|
||||||
if (grabc->ismaster) {
|
if (grabc->ismaster) {
|
||||||
delta_x = (float)(cursor->x - begin_cursorx) *
|
delta_x = (float)(cursor->x - begin_cursorx) *
|
||||||
(grabc->old_master_width_per) /
|
(grabc->old_master_width_per) / grabc->begin_geom.width;
|
||||||
grabc->begin_geom.width;
|
|
||||||
delta_y = (float)(cursor->y - begin_cursory) *
|
delta_y = (float)(cursor->y - begin_cursory) *
|
||||||
(grabc->old_master_height_per) /
|
(grabc->old_master_height_per) / grabc->begin_geom.height;
|
||||||
grabc->begin_geom.height;
|
|
||||||
} else {
|
} else {
|
||||||
delta_x = (float)(cursor->x - begin_cursorx) *
|
delta_x = (float)(cursor->x - begin_cursorx) *
|
||||||
(1 - grabc->old_master_width_per) /
|
(1 - grabc->old_master_width_per) /
|
||||||
grabc->begin_geom.width;
|
grabc->begin_geom.width;
|
||||||
delta_y = (float)(cursor->y - begin_cursory) *
|
delta_y = (float)(cursor->y - begin_cursory) *
|
||||||
(grabc->old_slave_height_per) /
|
(grabc->old_slave_height_per) / grabc->begin_geom.height;
|
||||||
grabc->begin_geom.height;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool moving_up = cursor->y < begin_cursory;
|
bool moving_up = cursor->y < begin_cursory;
|
||||||
bool moving_down = cursor->y > begin_cursory;
|
bool moving_down = cursor->y > begin_cursory;
|
||||||
|
|
||||||
|
|
||||||
if (grabc->ismaster && !prev) {
|
if (grabc->ismaster && !prev) {
|
||||||
if (moving_up) {
|
if (moving_up) {
|
||||||
delta_y = -fabsf(delta_y);
|
delta_y = -fabsf(delta_y);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue