Skip to content

Commit

Permalink
added coment and extract dropTarget variable
Browse files Browse the repository at this point in the history
  • Loading branch information
asturur committed Jan 15, 2023
1 parent c0fa8fb commit 3dd25c2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/canvas/canvas_events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -337,12 +337,13 @@ export class Canvas extends SelectableCanvas {
) {
let dirty = false;
// clear top context
const dropTarget = this._dropTarget;
if (
this._dropTarget &&
this._dropTarget !== source &&
this._dropTarget !== target
dropTarget &&
dropTarget !== source &&
dropTarget !== target
) {
this._dropTarget.clearContextTop();
dropTarget.clearContextTop();
dirty = true;
}
source?.clearContextTop();
Expand Down
3 changes: 3 additions & 0 deletions src/mixins/itext_click_behavior.mixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,9 @@ export abstract class ITextClickBehaviorMixin<
return;
}

// mousedown is going to early return if isDragging is true.
// this is here to recover the setCursorByClick in case the
// isDragging is a false positive.
shouldSetCursor && this.setCursorByClick(options.e);

if (this.__lastSelected && !this.__corner) {
Expand Down

0 comments on commit 3dd25c2

Please sign in to comment.