question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CSS2DObject - potential rendering issue in Safari MacOS

See original GitHub issue

Describe the bug

Our team has used Three.JS to create a Virtual Tour content type that allows content authors to create interactions which enables the user to navigate around a scene, click on interactions and change to different scenes.

We’ve recently updated our this content type to work with labels which are 2d objects. However after testing in Safari we started to notice that lines would be drawn all over the scene from our labels. These lines go away when you hover over a label again however they keep on coming back and look quite distracting for a user.

Potential fix

I found that by using whole numbers, rather than decimal numbers, for the pixel position of the buttons (which the labels that cause the issue are a child of). This would be done by adding Math.round twice on this line. I’ve made the change on our fork of the Three.JS library and it has has issue has been gone since.

I was wondering if anyone had noticed any issue like this and if this fix is valid? Or if it’s instead caused by another change we made somewhere.

Code

https://github.com/h5p/h5p-three-image/tree/release https://github.com/h5p/h5p-three-js https://github.com/h5p/h5p-three-sixty/tree/release

Demo

https://staging.h5p.org/node/622030

Screenshot and video

https://www.screencast.com/t/1J7ZjSWc

Screenshot 2021-03-05 at 14 06 20

Platform:

  • Device: [Desktop]
  • OS: [MacOS]
  • Browser: [Safari]
  • Three.js version: [Not sure, but was updated Feb 2019]

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:13 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
mrdoobcommented, Mar 5, 2021

I don’t think it’s the same issue. I think #20069 is about WebKit rounding numbers internally. This issue is about WebKit not invalidating the drawn area correctly so it leaves trails. Chrome used to have this issue years ago.

1reaction
elalishcommented, Mar 9, 2021

Hmm, I don’t repro the bug on my macbook pro on Safari using this hotspots example: https://modelviewer.dev/examples/annotations/index.html#addHotspots

This uses the CSS2DRenderer, so maybe there’s a different workaround? I’m a little concerned about rounding to integer pixels since there are now commonly several real pixels per CSS pixel. I think it could adversely affect smoothness of motion.

Read more comments on GitHub >

github_iconTop Results From Across the Web

CSS3DRenderer offset for Safari on High DPI displays with ...
Description of the problem When combining a webgl renderer with a ... CSS2DObject - potential rendering issue in Safari MacOS #21415.
Read more >
Safari not rendering javascript or css on… - Apple Community
Safari not rendering javascript or css on some pages in MacOS. Works fine on another Mac and iPad. For whatever reason, on a...
Read more >
Why does my CSS code renders incorrectly on iOS/MacOS?
We developed a web app on Vue 3 and it displays perfectly on every browser except on iOS and Mac OS devices. This...
Read more >
Rendering Bug with Metal (iOs, macOS) - three.js forum
We've found this bug when installing iOS 15 beta. It ruins all rendering when post processing is enabled or when transmission is enabled...
Read more >
HLS WebGL video textures black rendering since IOS 11
Although Safari 11 suffers a FlipY issue on macOS still when using HLS. I just tested it. I have documented a fix for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found