[retro-gtk] gl-display: Account for window scale
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [retro-gtk] gl-display: Account for window scale
- Date: Thu, 26 Jul 2018 21:20:58 +0000 (UTC)
commit 28616a0b1c4657509eaa782c8a4b6a549224feed
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date: Fri Jul 27 00:32:37 2018 +0500
gl-display: Account for window scale
Fixes RetroGLDisplay rendering on HiDPI.
retro-gtk/retro-gl-display.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/retro-gtk/retro-gl-display.c b/retro-gtk/retro-gl-display.c
index 860e13e..93a8ea8 100644
--- a/retro-gtk/retro-gl-display.c
+++ b/retro-gtk/retro-gl-display.c
@@ -88,6 +88,7 @@ retro_gl_display_get_video_box (RetroGLDisplay *self,
gdouble h;
gdouble display_ratio;
gdouble allocated_ratio;
+ gint scale;
g_return_if_fail (RETRO_IS_GL_DISPLAY (self));
g_return_if_fail (width != NULL);
@@ -95,8 +96,10 @@ retro_gl_display_get_video_box (RetroGLDisplay *self,
g_return_if_fail (x != NULL);
g_return_if_fail (y != NULL);
- w = (gdouble) gtk_widget_get_allocated_width (GTK_WIDGET (self));
- h = (gdouble) gtk_widget_get_allocated_height (GTK_WIDGET (self));
+ scale = gtk_widget_get_scale_factor (GTK_WIDGET (self));
+
+ w = (gdouble) gtk_widget_get_allocated_width (GTK_WIDGET (self)) * scale;
+ h = (gdouble) gtk_widget_get_allocated_height (GTK_WIDGET (self)) * scale;
// Set the size of the display.
display_ratio = (gdouble) self->aspect_ratio;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]