Skip to content

Commit cf7dcfe

Browse files
authored
gg: handle dpi change, when moving window to another monitor (#20886)
1 parent 0514de7 commit cf7dcfe

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

vlib/gg/gg.c.v

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,8 @@ fn gg_event_fn(ce voidptr, user_data voidptr) {
406406
}
407407
}
408408
.resized {
409+
ctx.scale = dpi_scale()
410+
ctx.ft.scale = ctx.scale
409411
if ctx.config.resized_fn != unsafe { nil } {
410412
ctx.config.resized_fn(e, ctx.config.user_data)
411413
}

vlib/gg/text_rendering.c.v

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ pub:
1616
font_bold int
1717
font_mono int
1818
font_italic int
19-
scale f32 = 1.0
19+
pub mut:
20+
scale f32 = 1.0
2021
}
2122

2223
fn new_ft(c FTConfig) ?&FT {

0 commit comments

Comments
 (0)