[gnome-maps] Improve zoom travel
- From: Jonas Danielsson <jonasdn src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-maps] Improve zoom travel
- Date: Sat, 10 Oct 2015 21:59:57 +0000 (UTC)
commit d5b807d914e42315cd2bac1f790d5c951b79f82a
Author: Jonas Danielsson <jonas threetimestwo org>
Date: Sat Oct 10 23:46:12 2015 +0200
Improve zoom travel
src/mapMarker.js | 6 ++++--
src/mapWalker.js | 3 +--
2 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/src/mapMarker.js b/src/mapMarker.js
index e31290f..92cc4e9 100644
--- a/src/mapMarker.js
+++ b/src/mapMarker.js
@@ -70,8 +70,10 @@ const MapMarker = new Lang.Class({
_onButtonPress: function(marker, event) {
// Zoom in on marker on double-click
if (event.get_click_count() > 1) {
- this._view.zoom_level = this._view.max_zoom_level - 1;
- this._view.center_on(this.latitude, this.longitude);
+ if (this._view.zoom_level < this._view.max_zoom_level - 1) {
+ this._view.zoom_level = this._view.max_zoom_level - 1;
+ this._view.center_on(this.latitude, this.longitude);
+ }
}
},
diff --git a/src/mapWalker.js b/src/mapWalker.js
index 301ff70..b8365e3 100644
--- a/src/mapWalker.js
+++ b/src/mapWalker.js
@@ -56,9 +56,8 @@ const MapWalker = new Lang.Class({
// Zoom to the maximal zoom-level that fits the place type
zoomToFit: function() {
let zoom;
-
if (this._boundingBox !== null) {
- this._view.zoom_level = this._view.max_zoom_level;
+ this._view.zoom_level = this._view.max_zoom_level - 1;
this._view.ensure_visible(this._boundingBox, false);
} else {
switch (this.place.place_type) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]