Skip to content

Commit

Permalink
Search the target again on mouse up
Browse files Browse the repository at this point in the history
  • Loading branch information
asturur committed Apr 25, 2016
1 parent 81faf42 commit b95b4d2
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/mixins/canvas_events.mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,21 +249,20 @@
* @param {Event} e Event object fired on mouseup
*/
__onMouseUp: function (e) {
var target;
var target, searchTarget = true, transform = this._currentTransform;

if (this.isDrawingMode && this._isCurrentlyDrawing) {
this._onMouseUpInDrawingMode(e);
return;
}

if (this._currentTransform) {
if (transform) {
this._finalizeCurrentTransform();
target = this._currentTransform.target;
}
else {
target = this.findTarget(e, true);
searchTarget = !transform.actionPerformed;
}

target = searchTarget ? this.findTarget(e, true) : transform.target;

var shouldRender = this._shouldRender(target, this.getPointer(e));

this._maybeGroupObjects(e);
Expand All @@ -280,11 +279,12 @@
_handleCursorAndEvent: function(e, target) {
this._setCursorFromEvent(e, target);

// Can't find any reason, disabling for now
// TODO: why are we doing this?
var _this = this;
/* var _this = this;
setTimeout(function () {
_this._setCursorFromEvent(e, target);
}, 50);
}, 50); */

this.fire('mouse:up', { target: target, e: e });
target && target.fire('mouseup', { e: e });
Expand Down

0 comments on commit b95b4d2

Please sign in to comment.