-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
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
CSS2DRenderer: Round values used for translation. #21416
Conversation
Do you mind running |
This comment has been minimized.
This comment has been minimized.
That looks right. You should see with git that |
@Mugen87 sorry forgot to push! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even if this PR fixes your problem, it would be good if you could report it to WebKit: https://bugs.webkit.org/
If WebKit would fix the issue, this change would not be required and could be reverted.
@elalish I think you're one of the few users of |
Considering this only affects Safari I think it'd be better to do this: if ( /apple/i.test( navigator.vendor ) ) {
// https://github.com/mrdoob/three.js/issues/21415
element.style.transform = 'translate(-50%,-50%) translate(' + Math.round( vector.x * _widthHalf + _widthHalf ) + 'px,' + Math.round( - vector.y * _heightHalf + _heightHalf ) + 'px)';
} else {
element.style.transform = 'translate(-50%,-50%) translate(' + ( vector.x * _widthHalf + _widthHalf ) + 'px,' + ( - vector.y * _heightHalf + _heightHalf ) + 'px)';
} |
@simondate Do you mind updating the PR with @mrdoob's suggestion? |
Now it depends whether we want to risk this change or not, see #21415 (comment). |
I don't see much risk... Labels movement won't be as smooth in Safari but that's it I think. |
Related issue: Fixed #21415
Description
Uses Math.round to set only whole numbers for values being used by CSS2DRenderer