-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Calculating mouse position based on canvas bounding rectangle for emb… #2942
Conversation
This will be a bit more involved, but I think we want to cache the bounds (e.g., in |
Is this what you meant by using the throttledTick and window resize event together? |
Close, I meant just |
I think this is what you mean, copying the style of 'throttledEmitComponentChanged' in component.js. The Library drag component library that was being used has the same issue. |
OK, I see. We want to use module.exports.debounce = function (func, wait, immediate) {
var timeout;
return function() {
var context = this, args = arguments;
var later = function() {
timeout = null;
if (!immediate) func.apply(context, args);
};
var callNow = immediate && !timeout;
clearTimeout(timeout);
timeout = setTimeout(later, wait);
if (callNow) func.apply(context, args);
};
}; And use |
Ok I've added the debounce function in and it works better now. |
Thanks! |
…edded scenes
Description:
For this issue:
#2938
Not sure about the performance impacts, and whether this code should only execute for if scenes have the 'embedded' attribute
Changes proposed: