Skip to content

Commit

Permalink
Fix rotation handle position
Browse files Browse the repository at this point in the history
Change-Id: I75b3c2ff343828d00d263edb236e0d90f3d51f7f
Signed-off-by: mert <[email protected]>
  • Loading branch information
mert authored and merttumer committed Mar 1, 2021
1 parent 244aa7e commit 8594118
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions loleaflet/src/layer/vector/Path.Transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ L.Handler.PathTransform = L.Handler.extend({
se = rectangleHandles['8'][0];
return [sw, west, nw, north, ne, east, se, south];
}

this.options.rotation = false;
return [];
},

Expand Down Expand Up @@ -616,15 +616,8 @@ L.Handler.PathTransform = L.Handler.extend({
*/
_createRotationHandlers: function() {
var map = this._map;
var latlngs = this._rect._latlngs;

var bottom = new L.LatLng(
(latlngs[0].lat + latlngs[3].lat) / 2,
(latlngs[0].lng + latlngs[3].lng) / 2);
// hehe, top is a reserved word
var topPoint = new L.LatLng(
(latlngs[1].lat + latlngs[2].lat) / 2,
(latlngs[1].lng + latlngs[2].lng) / 2);
var bottom = map._docLayer._twipsToLatLng(this._getPoints()[7].point);
var topPoint = map._docLayer._twipsToLatLng(this._getPoints()[3].point);

var handlerPosition = map.layerPointToLatLng(
L.PathTransform.pointOnLine(
Expand Down Expand Up @@ -909,7 +902,6 @@ L.Handler.PathTransform = L.Handler.extend({
map.dragging.disable();
this._mapDraggingWasEnabled = true;
}

this._originMarker = null;
this._rotationOriginPt = map.latLngToLayerPoint(this._getRotationOrigin());
this._rotationStart = evt.layerPoint;
Expand Down

0 comments on commit 8594118

Please sign in to comment.