Skip to content

Instantly share code, notes, and snippets.

@Dmuasya
Created December 7, 2022 03:53
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
canvas.findTarget = (function(b) {
return function() {
var a = b.apply(this, arguments);
if (a) {
if (this._hoveredTarget !== a) {
canvas.fire('object:over', {
target: a
});
if (this._hoveredTarget) {
canvas.fire('object:out', {
target: this._hoveredTarget
})
}
this._hoveredTarget = a
}
} else if (this._hoveredTarget) {
canvas.fire('object:out', {
target: this._hoveredTarget
});
this._hoveredTarget = null
}
return a
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment