[gnome-games] Revert "Revert "gamepad-view: Stop accessing Rsvg.Handle fields""
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games] Revert "Revert "gamepad-view: Stop accessing Rsvg.Handle fields""
- Date: Sat, 6 Apr 2019 17:38:23 +0000 (UTC)
commit 33c2a0103f10fb9e8c34297503922cfcbec0e697
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date: Sat Apr 6 22:37:33 2019 +0500
Revert "Revert "gamepad-view: Stop accessing Rsvg.Handle fields""
Seems the version in 3.32 sdk already has the change.
This reverts commit 46c7983f0f487863d0712ed92a0cfbdee77dc72e.
src/ui/gamepad-view.vala | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
---
diff --git a/src/ui/gamepad-view.vala b/src/ui/gamepad-view.vala
index f917f785..86494130 100644
--- a/src/ui/gamepad-view.vala
+++ b/src/ui/gamepad-view.vala
@@ -26,7 +26,11 @@ private class Games.GamepadView : Gtk.DrawingArea {
critical ("Could not set up gamepad view: %s", e.message);
}
- set_size_request (handle.width, handle.height);
+ Rsvg.Rectangle rect = {};
+ if (!handle.get_geometry_sub (null, out rect, null))
+ assert_not_reached ();
+
+ set_size_request ((int) rect.width, (int) rect.height);
input_highlights = new bool[value.input_paths.length];
reset ();
@@ -101,9 +105,13 @@ private class Games.GamepadView : Gtk.DrawingArea {
double w = get_allocated_width ();
double h = get_allocated_height ();
- scale = double.min (h / handle.height, w / handle.width);
+ Rsvg.Rectangle rect = {};
+ if (!handle.get_geometry_sub (null, out rect, null))
+ assert_not_reached ();
+
+ scale = double.min (h / rect.height, w / rect.width);
- x = (w - handle.width * scale) / 2;
- y = (h - handle.height * scale) / 2;
+ x = (w - rect.width * scale) / 2;
+ y = (h - rect.height * scale) / 2;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]