Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove reference to lastRenderedWithControls when that object is deleted #3023

Merged
merged 1 commit into from Jun 2, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/canvas.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -1361,6 +1361,17 @@
this._objects[i]._renderControls(ctx);
this.lastRenderedWithControls = this._objects[i];
}
},

/**
* @private
* @param {fabric.Object} obj Object that was removed
*/
_onObjectRemoved: function(obj) {
if (obj === this.lastRenderedWithControls) {
delete this.lastRenderedWithControls;
}
this.callSuper('_onObjectRemoved', obj);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would it not fit in StaticCanvas more than Canvas? StaticCanvas does not have interactivity layer but still can render controls.
Other than that it look goods to me.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this.lastRenderedWithControls is defined in the canvas.class.js. Should I move all uses of the flag to StaticCanvas?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no you are right, it does not belong in StaticCanvas. is it fine like it is.

}
});

Expand Down