Skip to content
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

snap.svg.zpd does not work as intended if viewBox is set #12

Closed
tikiatua opened this issue Oct 10, 2014 · 9 comments
Closed

snap.svg.zpd does not work as intended if viewBox is set #12

tikiatua opened this issue Oct 10, 2014 · 9 comments

Comments

@tikiatua
Copy link
Collaborator

SVG-images can be made responsively by using the viewBox attribute and setting it to the size of the svg content. The svg-element will then fit the content to the width its container.

Unfortunately, the snap.svg.zpd-library does currently not work as intended in this case, as it does not factor in the transformation already applied to the svg-element through the viewBox.

I am currently creating a new version of the library that will incorporate this functionality. There might though be some breaking api-changes.

Please stay tuned for more.. A beta-release can be expected next week.

@hueitan
Copy link
Owner

hueitan commented Oct 10, 2014

I haven't tried it yet. Would you mind give a sample code about this? It's better having a demo than the words.

Look forward for the beta version! hooray !!!

@tikiatua
Copy link
Collaborator Author

The beta is now online. Functionality is currently very limited. I will add more methods in the next days.

@hueitan
Copy link
Owner

hueitan commented Oct 14, 2014

Nice. I saw it!
Remember to code review between us before push to master.

Thanks

@tikiatua
Copy link
Collaborator Author

Sure thing.. I think we should probably also create some unit-test (although I am not yet completely sure, how we should test the events)

@tikiatua
Copy link
Collaborator Author

Just found out, that the mousewheel-event is a major headache in Firefox. "Mouse-wheeling" over a svg-element on a page with scrollbars will automatically scroll the page as well.. The common solutions do not seem to work (event.stopPropagation(); event.preventDefault; event.cancelBubble = false; event.returnValue = false; and returning false from the function).

Any ideas would be most welcome.

@tikiatua
Copy link
Collaborator Author

wohaa fixed the firefox issue.. we have to use paper.node.onwheel = function(event){..} with event canceling to make it work in newer firefox browsers. Updated the code accordingly

@hueitan hueitan added this to the v0.1.0 stable milestone Oct 17, 2014
@hueitan
Copy link
Owner

hueitan commented Oct 17, 2014

Is this working now? then can I close it ?

@tikiatua
Copy link
Collaborator Author

There is still an issue using the zoomTo-function if the element is rotated.. dragging of elements and plugin-option are not yet available.. Might get around to it next week.

@hueitan
Copy link
Owner

hueitan commented Nov 6, 2014

duplicate with #15

@hueitan hueitan closed this as completed Nov 6, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants