[gnome-games/wip/exalm/332: 3/4] Revert "gamepad-view: Stop accessing Rsvg.Handle fields"



commit 46c7983f0f487863d0712ed92a0cfbdee77dc72e
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date:   Sat Apr 6 12:43:03 2019 +0500

    Revert "gamepad-view: Stop accessing Rsvg.Handle fields"
    
    This reverts commit 3c33d1aa3b2e177ed055e6865b3fc6229cf911d6.

 src/ui/gamepad-view.vala | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)
---
diff --git a/src/ui/gamepad-view.vala b/src/ui/gamepad-view.vala
index 86494130..f917f785 100644
--- a/src/ui/gamepad-view.vala
+++ b/src/ui/gamepad-view.vala
@@ -26,11 +26,7 @@ private class Games.GamepadView : Gtk.DrawingArea {
                                critical ("Could not set up gamepad view: %s", e.message);
                        }
 
-                       Rsvg.Rectangle rect = {};
-                       if (!handle.get_geometry_sub (null, out rect, null))
-                               assert_not_reached ();
-
-                       set_size_request ((int) rect.width, (int) rect.height);
+                       set_size_request (handle.width, handle.height);
                        input_highlights = new bool[value.input_paths.length];
 
                        reset ();
@@ -105,13 +101,9 @@ private class Games.GamepadView : Gtk.DrawingArea {
                double w = get_allocated_width ();
                double h = get_allocated_height ();
 
-               Rsvg.Rectangle rect = {};
-               if (!handle.get_geometry_sub (null, out rect, null))
-                       assert_not_reached ();
-
-               scale = double.min (h / rect.height, w / rect.width);
+               scale = double.min (h / handle.height, w / handle.width);
 
-               x = (w - rect.width * scale) / 2;
-               y = (h - rect.height * scale) / 2;
+               x = (w - handle.width * scale) / 2;
+               y = (h - handle.height * scale) / 2;
        }
 }


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