[gnome-games/wip/exalm/ds: 3/16] retro-runner: Stop using x-dpi and y-dpi



commit 6126b35874a19be730041340d4a4136babe2b1b4
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date:   Wed Aug 14 13:01:33 2019 +0500

    retro-runner: Stop using x-dpi and y-dpi
    
    retro-gtk deprecated them, use aspect-ratio instead.

 src/retro/retro-runner.vala | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)
---
diff --git a/src/retro/retro-runner.vala b/src/retro/retro-runner.vala
index 37a16ad4..49535ec7 100644
--- a/src/retro/retro-runner.vala
+++ b/src/retro/retro-runner.vala
@@ -554,20 +554,12 @@ public class Games.RetroRunner : Object, Runner {
                if (pixbuf == null)
                        return 0;
 
-               var x_dpi = pixbuf.get_option ("x-dpi");
-               var y_dpi = pixbuf.get_option ("y-dpi");
+               var aspect_ratio_str = pixbuf.get_option ("aspect-ratio") ?? "";
 
-               if (x_dpi == null || y_dpi == null)
-                       return 0;
-
-               float x = 0, y = 0;
-               x_dpi.scanf ("%g", out x);
-               y_dpi.scanf ("%g", out y);
-
-               if (y == 0)
-                       return 0;
+               float result = 0;
+               aspect_ratio_str.scanf ("%g", out result);
 
-               return (double) x / y;
+               return (double) result;
        }
 
        private void save_screenshot_in_tmp () throws Error {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]