Skip to content

Commit

Permalink
Revert "Fix inconsistent draw.update fires (mapbox#1160) (h/t @gyne…
Browse files Browse the repository at this point in the history
…kolog)"

This reverts commit ad44350.
  • Loading branch information
danielsippel committed Apr 17, 2024
1 parent 4247cd8 commit fe01376
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
5 changes: 0 additions & 5 deletions src/modes/direct_select.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,15 +183,10 @@ DirectSelect.onMouseMove = function(state, e) {
// On mousemove that is not a drag, stop vertex movement.
const isFeature = isActiveFeature(e);
const onVertex = isVertex(e);
const isMidPoint = isMidpoint(e);
const noCoords = state.selectedCoordPaths.length === 0;
if (isFeature && noCoords) this.updateUIClasses({ mouse: Constants.cursors.MOVE });
else if (onVertex && !noCoords) this.updateUIClasses({ mouse: Constants.cursors.MOVE });
else this.updateUIClasses({ mouse: Constants.cursors.NONE });

const isDraggableItem = onVertex || isFeature || isMidPoint;
if (isDraggableItem && state.dragMoving) this.fireUpdate();

this.stopDragging(state);

// Skip render
Expand Down
5 changes: 1 addition & 4 deletions src/modes/simple_select.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,7 @@ SimpleSelect.onStop = function() {
doubleClickZoom.enable(this);
};

SimpleSelect.onMouseMove = function(state, e) {
const isFeature = CommonSelectors.isFeature(e);
if (isFeature && state.dragMoving) this.fireUpdate();

SimpleSelect.onMouseMove = function(state) {
// On mousemove that is not a drag, stop extended interactions.
// This is useful if you drag off the canvas, release the button,
// then move the mouse back over the canvas --- we don't allow the
Expand Down

0 comments on commit fe01376

Please sign in to comment.