Skip to content

Commit

Permalink
[2D Map] Fixed again: "when reaching maxzoom, dont shift the map anym…
Browse files Browse the repository at this point in the history
…ore"

#370
  • Loading branch information
wolfgang-ch committed Jul 29, 2021
1 parent b59ca25 commit b0ea5fd
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions bundles/net.tourbook/src/de/byteholder/geoclipse/map/Map.java
Original file line number Diff line number Diff line change
Expand Up @@ -4028,13 +4028,13 @@ private void paint_HoveredTour_50_TourInfo(final GC gc) {
/*
* This is for debugging
*/
// final boolean isShowHoverRectangle = false;
// final boolean isShowHoverRectangle = true;
// if (isShowHoverRectangle) {
//
// // paint hovered rectangle
// gc.setLineWidth(1);
//
// for (final Point hoveredPoint : _devHoveredPoint) {
// for (final Point hoveredPoint : _allDevHoveredPoints) {
//
// gc.setAlpha(0x60);
// gc.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_GREEN));
Expand Down Expand Up @@ -4068,6 +4068,9 @@ private void paint_HoveredTour_50_TourInfo(final GC gc) {
// this occurred, it can be that previously a history/multiple tour was displayed

} else {

// tour data are available

paint_HoveredTour_52_TourDetail(gc, devXMouse, devYMouse, tourData);
}

Expand Down Expand Up @@ -6366,10 +6369,20 @@ public void setZoom(final int newZoomLevel) {
adjustedZoomLevel = Math.min(adjustedZoomLevel, mpMaximumZoomLevel);
}

boolean isNewZoomLevel = false;

// check if zoom level has changed
if (oldZoomLevel == adjustedZoomLevel) {

// this is disabled that a double click can set the center of the map

// return;

} else {

// a new zoomlevel is set

isNewZoomLevel = true;
}

if (oldZoomLevel != adjustedZoomLevel) {
Expand Down Expand Up @@ -6404,7 +6417,7 @@ public void setZoom(final int newZoomLevel) {
if (_isZoomWithMousePosition

// fixes this "issue" https://github.com/wolfgang-ch/mytourbook/issues/370
&& _mapZoomLevel != adjustedZoomLevel) {
&& isNewZoomLevel) {

// set map center to the current mouse position

Expand Down

0 comments on commit b0ea5fd

Please sign in to comment.