Skip to content

Commit

Permalink
Set feature style to null to get faster feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
lehecht committed Oct 9, 2024
1 parent 9bc7b58 commit c6bc794
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions resources/assets/js/annotations/ol/MagicWandInteraction.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,14 +183,14 @@ class MagicWandInteraction extends PointerInteraction {
handleUpEvent() {
this.currentThreshold = this.colorThreshold;

if (this.isShowingCross) {
this.sketchSource.removeFeature(this.sketchFeature);
} else {
this.dispatchEvent({type: 'drawend', feature: this.sketchFeature});
if (!this.isShowingCross) {
this.sketchFeature.setStyle(null);
this.dispatchEvent({ type: 'drawend', feature: this.sketchFeature });
// Add feature to annotation source to prevent flickering feature
this.source.addFeature(this.sketchFeature);
this.sketchSource.removeFeature(this.sketchFeature);
}

this.sketchSource.removeFeature(this.sketchFeature);

this.sketchFeature = null;

Expand Down

0 comments on commit c6bc794

Please sign in to comment.