aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2021-12-29 10:52:48 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-12-29 10:52:48 +0000
commit0a656d75d4418ea4804ff52cb6fa8b8a74c7438b (patch)
tree0433b8f98cd5e84bb7b3c7eda0eb1b866da5e659
parentMerge branch 'apply-scrollback-multiplier-in-alternate-scroll-mode' (diff)
parentrender: scale the width out the outline of the unfocused block cursor (diff)
Merge branch 'scale-outline-of-unfocused-block-cursor'
-rw-r--r--CHANGELOG.md3
-rw-r--r--render.c10
2 files changed, 9 insertions, 4 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0fa3c0c3..e34e5823 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -54,6 +54,9 @@
* `[scrollback].multiplier` is now applied in “alternate scroll” mode,
where scroll events are translated to fake arrow key presses on the
alt screen (https://codeberg.org/dnkl/foot/issues/859).
+* The width of the block cursor’s outline in an unfocused window is
+ now scaled by the output scaling factor (“desktop
+ scaling”). Previously, it was always 1px.
### Deprecated
diff --git a/render.c b/render.c
index 3cbe0e5a..392f90de 100644
--- a/render.c
+++ b/render.c
@@ -317,13 +317,15 @@ static void
draw_unfocused_block(const struct terminal *term, pixman_image_t *pix,
const pixman_color_t *color, int x, int y, int cell_cols)
{
+ const int scale = term->scale;
+
pixman_image_fill_rectangles(
PIXMAN_OP_SRC, pix, color, 4,
(pixman_rectangle16_t []){
- {x, y, cell_cols * term->cell_width, 1}, /* top */
- {x, y, 1, term->cell_height}, /* left */
- {x + cell_cols * term->cell_width - 1, y, 1, term->cell_height}, /* right */
- {x, y + term->cell_height - 1, cell_cols * term->cell_width, 1}, /* bottom */
+ {x, y, cell_cols * term->cell_width, scale}, /* top */
+ {x, y, scale, term->cell_height}, /* left */
+ {x + cell_cols * term->cell_width - scale, y, scale, term->cell_height}, /* right */
+ {x, y + term->cell_height - scale, cell_cols * term->cell_width, scale}, /* bottom */
});
}