-
Notifications
You must be signed in to change notification settings - Fork 388
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
Why svg-pan-zoom uses transform over a <g> element? #147
Comments
This functionality has roots in the original library. However it still seems to be a good choice because:
Maybe @ariutta has some more comments on that. |
It's a fair question that I asked as well. That issue links to a good demo of a @bumbu has the right answer -- initially used our current method because it was how the original library did it. We kept it because this method gives us more control, as @bumbu describes. But for simple use cases, the I wish I had time to test how GPU acceleration relates to pan/zoom via CSS transform vs viewBox. I know some browsers use acceleration for at least some CSS transforms, but the only thing I've heard about it with regard to the viewBox was this: |
Yeah the fact that they have decided to remove those redraw control methods suspend/unsuspend was really .. well I just wanted to throw my pc out the window when they did that. But I understand their reasoning (http://dschulze.com/blog/articles/4/efficient-redrawing-on-svg-or-why-suspendredraw-is-a-lie) to some degree .. although they could have made them optional. Anyway, are svg-transforms the same thing as CSS transforms are they based in the same ecosystem ? I will do some tests with the svg-pan-zoom library to see how it fares with very big scenes. Thanks |
I think the syntax for CSS and SVG transform matrices is supposed to be the
|
Check this out: http://xn--dahlstrm-t4a.net/svg/performance/view-animation/harness.html Click to toggle method between a translate(), viewBox and currentTranslate. |
I tested this on few different machines and different browsers and the results were quite similar (deviation of 1-2 frames per second). And it seems that on modern mobile browsers it is the same. Does anyone else get the same results of something different? |
I suppose this question was answered. If it is necessary - we can reopen it. |
Victor Rizea sent me an email with following question:
I'm sure that other people may have the same question. So I decided to answer it here so that we could discuss it publicly.
The text was updated successfully, but these errors were encountered: