[gnome-maps/gnome-40] Revert "mapMarker: Improve marker reposion when not fitting below"



commit 8f29bf8b2ee44cb290566ac93617ed8e73a71227
Author: Marcus Lundblad <ml update uu se>
Date:   Thu Apr 29 23:02:53 2021 +0200

    Revert "mapMarker: Improve marker reposion when not fitting below"
    
    This reverts commit 6ca991733fac1103437385270f2eb4494a387dfb.

 src/mapMarker.js | 18 ++++--------------
 1 file changed, 4 insertions(+), 14 deletions(-)
---
diff --git a/src/mapMarker.js b/src/mapMarker.js
index eb2747ab..7fb45201 100644
--- a/src/mapMarker.js
+++ b/src/mapMarker.js
@@ -240,23 +240,13 @@ var MapMarker = GObject.registerClass({
         let bubbleSize = bubble.get_preferred_size()[1];
 
         // Set bubble position left/right if it's close to a vertical map edge
-        if (pos.x + pos.width / 2 + bubbleSize.width / 2 >= mapSize.width) {
+        if (pos.x + pos.width / 2 + bubbleSize.width / 2 >= mapSize.width)
             bubble.position = Gtk.PositionType.LEFT;
-        } else if (pos.x + pos.width / 2 - bubbleSize.width / 2 <= 0) {
+        else if (pos.x + pos.width / 2 - bubbleSize.width / 2 <= 0)
             bubble.position = Gtk.PositionType.RIGHT;
         // Avoid bubble to cover header bar if the marker is close to the top map edge
-        } else if (pos.y - bubbleSize.height <= 0) {
-            /* position bubble below marker if there's enough room,
-             * otherwise choose left or right pointing away from the edge
-             * closest to the marker
-             */
-            if (mapSize.height - pos.y >= bubbleSize.height)
-                bubble.position = Gtk.PositionType.BOTTOM;
-            else if (x >= mapSize.width / 2)
-                bubble.position = Gtk.PositionType.LEFT;
-            else
-                bubble.position = Gtk.PositionType.RIGHT;
-        }
+        else if (pos.y - bubbleSize.height <= 0)
+            bubble.position = Gtk.PositionType.BOTTOM;
     }
 
     _hideBubbleOn(signal, duration) {


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