mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-05-05 06:47:12 -04:00
format code
This commit is contained in:
parent
cf3cd6fe3f
commit
f459876e07
1 changed files with 33 additions and 38 deletions
31
src/mango.c
31
src/mango.c
|
|
@ -3628,7 +3628,7 @@ void set_size_per(Monitor *m, Client *c) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!found) {
|
if (!found) {
|
||||||
c->master_width_per = 0.5f;
|
c->master_width_per = 0.5f;
|
||||||
c->master_height_per = 1.0f;
|
c->master_height_per = 1.0f;
|
||||||
c->slave_height_per = 1.0f;
|
c->slave_height_per = 1.0f;
|
||||||
|
|
@ -3917,47 +3917,42 @@ void resize_tile_client(Client *grabc) {
|
||||||
grabc->begin_geom = grabc->geom;
|
grabc->begin_geom = grabc->geom;
|
||||||
} else {
|
} else {
|
||||||
// 计算相对于屏幕尺寸的比例变化
|
// 计算相对于屏幕尺寸的比例变化
|
||||||
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);
|
||||||
} else {
|
} else {
|
||||||
delta_y = fabsf(delta_y);
|
delta_y = fabsf(delta_y);
|
||||||
}
|
}
|
||||||
} else if(grabc->ismaster && next && !next->ismaster) {
|
} else if (grabc->ismaster && next && !next->ismaster) {
|
||||||
if(moving_up) {
|
if (moving_up) {
|
||||||
delta_y = fabsf(delta_y);
|
delta_y = fabsf(delta_y);
|
||||||
} else {
|
} else {
|
||||||
delta_y = -fabsf(delta_y);
|
delta_y = -fabsf(delta_y);
|
||||||
}
|
}
|
||||||
} else if(!grabc->ismaster && prev && prev->ismaster) {
|
} else if (!grabc->ismaster && prev && prev->ismaster) {
|
||||||
if(moving_up) {
|
if (moving_up) {
|
||||||
delta_y = -fabsf(delta_y);
|
delta_y = -fabsf(delta_y);
|
||||||
} else {
|
} else {
|
||||||
delta_y = fabsf(delta_y);
|
delta_y = fabsf(delta_y);
|
||||||
}
|
}
|
||||||
} else if(!grabc->ismaster && !next) {
|
} else if (!grabc->ismaster && !next) {
|
||||||
if(moving_up) {
|
if (moving_up) {
|
||||||
delta_y = fabsf(delta_y);
|
delta_y = fabsf(delta_y);
|
||||||
} else {
|
} else {
|
||||||
delta_y = -fabsf(delta_y);
|
delta_y = -fabsf(delta_y);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue