@@ -1482,9 +1482,10 @@ static void gd_menu_zoom_fixed(GtkMenuItem *item, void *opaque)
{
GtkDisplayState *s = opaque;
VirtualConsole *vc = gd_vc_find_current(s);
+ int ws = gdk_window_get_scale_factor(gtk_widget_get_window(vc->gfx.drawing_area));
- vc->gfx.scale_x = 1.0;
- vc->gfx.scale_y = 1.0;
+ vc->gfx.scale_x = 1.0 / ws;
+ vc->gfx.scale_y = 1.0 / ws;
gd_update_windowsize(vc);
}
@@ -1493,13 +1494,15 @@ static void gd_menu_zoom_fit(GtkMenuItem *item, void *opaque)
{
GtkDisplayState *s = opaque;
VirtualConsole *vc = gd_vc_find_current(s);
+ int ws = gdk_window_get_scale_factor(gtk_widget_get_window(vc->gfx.drawing_area));
if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(s->zoom_fit_item))) {
s->free_scale = TRUE;
} else {
+ ws = gdk_window_get_scale_factor(gtk_widget_get_window(vc->gfx.drawing_area));
s->free_scale = FALSE;
- vc->gfx.scale_x = 1.0;
- vc->gfx.scale_y = 1.0;
+ vc->gfx.scale_x = 1.0 / ws;
+ vc->gfx.scale_y = 1.0 / ws;
}
gd_update_windowsize(vc);
Signed-off-by: Yujun <liuyujun@fingera.cn> --- ui/gtk.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)