From 86c91fc53ae7d40147791d1e44b5b92bfa18113c Mon Sep 17 00:00:00 2001 From: DreamMaoMao <2523610504@qq.com> Date: Wed, 15 Oct 2025 16:23:46 +0800 Subject: [PATCH] opt: optimize grid layout gap --- src/layout/horizontal.h | 16 ++++++++-------- src/layout/vertical.h | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/layout/horizontal.h b/src/layout/horizontal.h index ad2ae91..3bebd3d 100644 --- a/src/layout/horizontal.h +++ b/src/layout/horizontal.h @@ -34,8 +34,8 @@ void grid(Monitor *m) { ch = (m->w.height - 2 * target_gappo) * single_height_ratio; c->geom.x = m->w.x + (m->w.width - cw) / 2; c->geom.y = m->w.y + (m->w.height - ch) / 2; - c->geom.width = cw - 2 * c->bw; - c->geom.height = ch - 2 * c->bw; + c->geom.width = cw; + c->geom.height = ch; resize(c, c->geom, 0); return; } @@ -60,14 +60,14 @@ void grid(Monitor *m) { if (i == 0) { c->geom.x = m->w.x + target_gappo; c->geom.y = m->w.y + (m->w.height - ch) / 2 + target_gappo; - c->geom.width = cw - 2 * c->bw; - c->geom.height = ch - 2 * c->bw; + c->geom.width = cw; + c->geom.height = ch; resize(c, c->geom, 0); } else if (i == 1) { c->geom.x = m->w.x + cw + target_gappo + target_gappi; c->geom.y = m->w.y + (m->w.height - ch) / 2 + target_gappo; - c->geom.width = cw - 2 * c->bw; - c->geom.height = ch - 2 * c->bw; + c->geom.width = cw; + c->geom.height = ch; resize(c, c->geom, 0); } i++; @@ -114,8 +114,8 @@ void grid(Monitor *m) { } c->geom.x = cx + target_gappo; c->geom.y = cy + target_gappo; - c->geom.width = cw - 2 * c->bw; - c->geom.height = ch - 2 * c->bw; + c->geom.width = cw; + c->geom.height = ch; resize(c, c->geom, 0); i++; } diff --git a/src/layout/vertical.h b/src/layout/vertical.h index cac2217..3cddcba 100644 --- a/src/layout/vertical.h +++ b/src/layout/vertical.h @@ -316,8 +316,8 @@ void vertical_grid(Monitor *m) { cw = (m->w.width - 2 * target_gappo) * single_width_ratio; c->geom.x = m->w.x + (m->w.width - cw) / 2; c->geom.y = m->w.y + (m->w.height - ch) / 2; - c->geom.width = cw - 2 * c->bw; - c->geom.height = ch - 2 * c->bw; + c->geom.width = cw; + c->geom.height = ch; resize(c, c->geom, 0); return; } @@ -343,14 +343,14 @@ void vertical_grid(Monitor *m) { if (i == 0) { c->geom.x = m->w.x + (m->w.width - cw) / 2 + target_gappo; c->geom.y = m->w.y + target_gappo; - c->geom.width = cw - 2 * c->bw; - c->geom.height = ch - 2 * c->bw; + c->geom.width = cw; + c->geom.height = ch; resize(c, c->geom, 0); } else if (i == 1) { c->geom.x = m->w.x + (m->w.width - cw) / 2 + target_gappo; c->geom.y = m->w.y + ch + target_gappo + target_gappi; - c->geom.width = cw - 2 * c->bw; - c->geom.height = ch - 2 * c->bw; + c->geom.width = cw; + c->geom.height = ch; resize(c, c->geom, 0); } i++; @@ -393,8 +393,8 @@ void vertical_grid(Monitor *m) { } c->geom.x = cx + target_gappo; c->geom.y = cy + target_gappo; - c->geom.width = cw - 2 * c->bw; - c->geom.height = ch - 2 * c->bw; + c->geom.width = cw; + c->geom.height = ch; resize(c, c->geom, 0); i++; }