[gnome-maps] Get rid of Clutter.Actor.set_anchor_point_from_gravity call



commit c0d9001c069ec3133b5d668597adeb54467ff6f9
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Thu Apr 18 03:40:42 2013 +0300

    Get rid of Clutter.Actor.set_anchor_point_from_gravity call
    
    This API is deprecated.

 src/userLocation.js | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/src/userLocation.js b/src/userLocation.js
index f5d18c1..e6b1e69 100644
--- a/src/userLocation.js
+++ b/src/userLocation.js
@@ -40,9 +40,13 @@ const UserLocation = new Lang.Class({
 
         this._locationMarker = new Champlain.CustomMarker();
         this._locationMarker.set_location(this.latitude, this.longitude);
-        // FIXME: Using deprecated function here cause I failed to get the same result
-        //        with this._locationMarker.set_pivot_point(0.5, 0).
-        this._locationMarker.set_anchor_point_from_gravity(Clutter.Gravity.SOUTH);
+        let allocationId = this._locationMarker.connect('notify::allocation', Lang.bind(this,
+            function() {
+                this._locationMarker.disconnect(allocationId);
+                this._locationMarker.set_translation(-(this._locationMarker.get_width() / 2),
+                                                     -this._locationMarker.get_height(),
+                                                     0);
+            }));
         let pin_actor = Utils.CreateActorFromImageFile(Path.ICONS_DIR + "/pin.svg");
         if (pin_actor == null)
             return;


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