After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 698282 - set location bubble pixel-aligned translation on notify::width
set location bubble pixel-aligned translation on notify::width
Status: RESOLVED FIXED
Product: gnome-maps
Classification: Applications
Component: map view
git master
Other Linux
: Normal normal
: ---
Assigned To: gnome-maps-maint
gnome-maps-maint
Depends on:
Blocks:
 
 
Reported: 2013-04-18 10:34 UTC by Jussi Kukkonen
Modified: 2013-04-26 01:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
UserLocation: set pixel-aligned translation on notify::width (1.46 KB, patch)
2013-04-18 10:34 UTC, Jussi Kukkonen
needs-work Details | Review
UserLocation: translate pin and bubble on notify::size (1.22 KB, patch)
2013-04-20 13:02 UTC, Jussi Kukkonen
committed Details | Review
UserLocation: pixel-align pin and bubble translation (1.13 KB, patch)
2013-04-20 13:02 UTC, Jussi Kukkonen
accepted-commit_now Details | Review
UserLocation: pixel-align pin and bubble translation (1.13 KB, patch)
2013-04-20 17:13 UTC, Jussi Kukkonen
committed Details | Review
Screenshot of issue (1.50 MB, image/png)
2013-04-24 02:44 UTC, Zeeshan Ali
  Details

Description Jussi Kukkonen 2013-04-18 10:34:52 UTC
Created attachment 241812 [details] [review]
UserLocation: set pixel-aligned translation on notify::width

Setting translation on first allocation is not enough as the size may
    change: Use notify::width as that's what the translation depends on.
    
    Also, make sure we only translate full pixels to avoid text smearing.
Comment 1 Zeeshan Ali 2013-04-18 13:57:06 UTC
Review of attachment 241812 [details] [review]:

Also I'd divide this in two patches:

1. Keep adjusting translation according to actor size changes
2. Pixel-align the x tanslation

::: src/userLocation.js
@@ +41,3 @@
         this._locationMarker = new Champlain.CustomMarker();
         this._locationMarker.set_location(this.latitude, this.longitude);
+        this._locationMarker.connect('notify::width', Lang.bind(this,

why only width? Do we know for sure that height is already allocated when width is?

@@ +44,2 @@
             function() {
+                this._locationMarker.set_translation(-(Math.floor(this._locationMarker.get_width() / 2)),

I'd use a variable here: let translate_x = -(Math.floor(this._locationMarker.get_width() / 2);
Comment 2 Jussi Kukkonen 2013-04-19 11:55:06 UTC
(In reply to comment #1)
> why only width? Do we know for sure that height is already allocated when width

You have a point, I wasn't thinking it through either... Luckily Actor has a "size" property as well. I'll fix that and other issues you mentioned. Thanks.
Comment 3 Jussi Kukkonen 2013-04-20 13:02:11 UTC
Created attachment 241998 [details] [review]
UserLocation: translate pin and bubble on notify::size

Setting translation on first allocation is not enough as the size may
change later: Use notify::size instead.
Comment 4 Jussi Kukkonen 2013-04-20 13:02:15 UTC
Created attachment 241999 [details] [review]
UserLocation: pixel-align pin and bubble translation

Avoid non-pixel-aligned actors as that leads to blurry text rendering.
Comment 5 Zeeshan Ali 2013-04-20 15:34:12 UTC
Review of attachment 241998 [details] [review]:

ACK
Comment 6 Zeeshan Ali 2013-04-20 15:35:34 UTC
Review of attachment 241999 [details] [review]:

ACK with this change.

::: src/userLocation.js
@@ +43,3 @@
         this._locationMarker.connect('notify::size', Lang.bind(this,
             function() {
+                let translate_x= -Math.floor(this._locationMarker.get_width() / 2);

space before '='
Comment 7 Jussi Kukkonen 2013-04-20 17:13:10 UTC
Created attachment 242010 [details] [review]
UserLocation: pixel-align pin and bubble translation

Avoid non-pixel-aligned actors as that leads to blurry text rendering.
Comment 8 Zeeshan Ali 2013-04-21 16:58:57 UTC
Review of attachment 242010 [details] [review]:

ACK. For future ref, if an ACK is given, you can simply directly push with the minor changes requested.
Comment 9 Zeeshan Ali 2013-04-22 14:11:58 UTC
Attachment 241998 [details] pushed as 5758d74 - UserLocation: translate pin and bubble on notify::size
Attachment 242010 [details] pushed as 8bdfced - UserLocation: pixel-align pin and bubble translation
Comment 10 Zeeshan Ali 2013-04-24 02:43:36 UTC
You fixed the translation of pin but not the accuracy circle.
Comment 11 Zeeshan Ali 2013-04-24 02:44:45 UTC
Created attachment 242303 [details]
Screenshot of issue

Screenshot of accuracy circle not being positioned correctly on zoom level changes.
Comment 12 Zeeshan Ali 2013-04-26 01:18:43 UTC
(In reply to comment #10)
> You fixed the translation of pin but not the accuracy circle.

NM, it turned out to be a Champlain issue. See bug#698910.