zircleUI / zircleUI

🚀 zircle-ui is a frontend library to develop zoomable user interfaces.

Home Page:https://zircleui.github.io/docs/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Zircle rendering at wrong position on Mobile browser

opened this issue · comments

https://codepen.io/zircle/pen/ejXaNY
On Android chrome, four layer down, zircle starts dipping from center of the screen. Same example works perfectly on Web chrome. On web, the zircle dips but renders itself to the center immediately, which is not happening on Android browser. Tested on Android chrome.

1
2
3
4

Thank you for informing this issue. Could you change the zircle version on codepen to zircle@1.4.0-rc.1 or zircle@1.4.0-beta.3 and test again on android?

Tested zircle@1.4.0-rc.1 and Zircle@1.4.0-beta.3

Result : Issue is persistent in Android Chrome and even web is affected.

Android Chrome

Level 1
1
Level 2
2
Level 3
3
Level 4
4
Level 5
5

Web

Level 1
Screenshot 2019-10-30 at 11 40 30 PM
Level 2
Screenshot 2019-10-30 at 11 40 46 PM
Level 3
Screenshot 2019-10-30 at 11 40 58 PM
Level 4
Screenshot 2019-10-30 at 11 41 09 PM
Level 5
Screenshot 2019-10-30 at 11 41 22 PM

When I did console log of X,Y in position.js for web and mobile

X = ((store.actions.getComponentWidth(parentSize) / 2) * distance / 100) * Math.cos(angle * (Math.PI / 180))
Y = ((store.actions.getComponentWidth(parentSize) / 2) * distance / 100) * Math.sin(angle * (Math.PI / 180))
console.log(X,Y)

For the same angle the X,Y are calculated to same decimal precision but they differ in deeper levels. Strange.

In my observation with zircle@stable, on the web the zircle dips down at deeper level but quickly comes back to the center.

Which makes me wonder, can the position be manually centered using css. Any suggestions?

Maybe this can be done by adding a css style with "!important" trying to override the transform property on the current view. However, I believe that to solve this issue it is better to rewrite the position "engine".

Thanks for the hint. Efforts to manually reset transform failed. When i dug deeper, i found this great article on browsers rounding up decimal points
Turns out that round up of decimal places in transform: translate3d is the culprit and position "engine" isn't at fault.

Zircle's strongest feature is zoom and out which asthetically depicts hierarchy. If zoom-in and out is just treated as animation and each z-view is rendered with absolute positioning, there's wont be a need to dilute the coordinate system [Background will be lost]. But it's better than enforcing levels on the framework.

Framework's calculation are correct. You may close this thread. Thanks.

Yes, sounds great, as long as transformation aren't in decimal coordinates the problem is solved. I think your new approach is absolutely correct. If the canvas made scaleable, zoom-in is practically infinite. Performance optimisation may be required, since all parents will need to be transformed not just scaled.