format code

This commit is contained in:
DreamMaoMao 2025-10-10 07:51:04 +08:00
parent cf3cd6fe3f
commit f459876e07

View file

@ -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);