Skip to content
Permalink
Browse files
zoomScale and zoomPoint doesn't consider map rotation (#6046)
  • Loading branch information
github-actions[bot] committed Apr 15, 2020
1 parent 82750e4 commit a283a6320497f0266fe39ccca75bea77203a3bd6
Showing 1 changed file with 10 additions and 0 deletions.
@@ -73,6 +73,11 @@
dY = dfDeltaY/((double)height);
dfGeoPosX = poGeorefExt->minx + dX * (double)poPixPos->x;
dfGeoPosY = poGeorefExt->maxy - dY * (double)poPixPos->y;

if (self->gt.rotation_angle != 0) {
dfGeoPosX = self->gt.geotransform[0] + self->gt.geotransform[1] * (double)poPixPos->x + self->gt.geotransform[2] * (double)poPixPos->y;
dfGeoPosY = self->gt.geotransform[3] + self->gt.geotransform[4] * (double)poPixPos->x + self->gt.geotransform[5] * (double)poPixPos->y;
}

/* --- -------------------------------------------------------- */
/* zoom in */
@@ -427,6 +432,11 @@
dY = dfDeltaY/((double)height);
dfGeoPosX = poGeorefExt->minx + dX * (double)poPixPos->x;
dfGeoPosY = poGeorefExt->maxy - dY * (double)poPixPos->y;

if (self->gt.rotation_angle != 0) {
dfGeoPosX = self->gt.geotransform[0] + self->gt.geotransform[1] * (double)poPixPos->x + self->gt.geotransform[2] * (double)poPixPos->y;
dfGeoPosY = self->gt.geotransform[3] + self->gt.geotransform[4] * (double)poPixPos->x + self->gt.geotransform[5] * (double)poPixPos->y;
}

/* ------------------------------------------------------------ */
/* Calculate new extents based on the scale. */

0 comments on commit a283a63

Please sign in to comment.