[gnome-games] display-bin: Check property value before setting



commit 3032108fba070bd70ee39acb4e4a2a39fde15461
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date:   Tue Aug 20 00:37:19 2019 +0500

    display-bin: Check property value before setting
    
    Avoid some unnecessary allocations.

 src/ui/display-bin.vala | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/src/ui/display-bin.vala b/src/ui/display-bin.vala
index a5480283..e9ad67b1 100644
--- a/src/ui/display-bin.vala
+++ b/src/ui/display-bin.vala
@@ -5,6 +5,9 @@ public class Games.DisplayBin : Gtk.Bin {
        public int horizontal_offset {
                get { return _horizontal_offset; }
                set {
+                       if (horizontal_offset == value)
+                               return;
+
                        _horizontal_offset = value;
                        queue_allocate ();
                }
@@ -14,6 +17,9 @@ public class Games.DisplayBin : Gtk.Bin {
        public int vertical_offset {
                get { return _vertical_offset; }
                set {
+                       if (vertical_offset == value)
+                               return;
+
                        _vertical_offset = value;
                        queue_allocate ();
                }


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