GNOME Bugzilla – Bug 699871
Centering before zooming-in changes the center of the view
Last modified: 2013-05-08 11:32:05 UTC
Centering the view on coordinates before zooming-in takes the view a bit off. centering *after* zooming in works as expected. i-e this doesn't work: this._view.center_on(this.latitude, this.longitude); this._view.set_zoom_level(zoom); but this does: this._view.set_zoom_level(zoom); this._view.center_on(this.latitude, this.longitude); Attaching screenshots to show the diff in action.
Created attachment 243535 [details] Screenshot of the problem
Created attachment 243536 [details] Screenshot of correct behavior
Would you try now? I think it was because of rounding errors of int vs double (the difference was multiplied by 2^deltazoom, which could be quite large). I haven't tested the result of the patch much and maybe something more has to be adjusted so please let me know if it works.
(In reply to comment #3) > Would you try now? I think it was because of rounding errors of int vs double > (the difference was multiplied by 2^deltazoom, which could be quite large). I > haven't tested the result of the patch much and maybe something more has to be > adjusted so please let me know if it works. Nope, I can still reproduce. :( One thing I noticed is that it seems to be the first-time zoom somehow that causes this and seems pretty unrelated to centering the map.
(In reply to comment #4) > (In reply to comment #3) > > Would you try now? I think it was because of rounding errors of int vs double > > (the difference was multiplied by 2^deltazoom, which could be quite large). I > > haven't tested the result of the patch much and maybe something more has to be > > adjusted so please let me know if it works. > > Nope, I can still reproduce. :( One thing I noticed is that it seems to be the > first-time zoom somehow that causes this and seems pretty unrelated to > centering the map. Yup. If I init the view to zoom-level '10', i can not reproduce this. Seems to only happen when going from small zoom (1-3) to bigger zoom.
Yeah, still the same problem I think. Try now - I've discovered one more case where the integer precision might not be enough.
Ouch, the patch has broken zooming completely - I have to investigate more.
Alright, stupid 2AM-coding bug. Fixed the previous commit.
Sorry, its still broken. :(
Yeah, one should really test things before blind coding :-). Fixed now (and fix tested).