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

Bug: jquery.vmap.min.js:10 Error: <g> attribute transform: Trailing garbage, "…0) translate(0, Infinity)". #333

Open
ghost opened this issue Oct 3, 2018 · 0 comments

Comments

@ghost
Copy link

ghost commented Oct 3, 2018

Hi, I found a bug when JQVMap is initialized in a canvas with height or width whoch is 0px

Overview:

In some case, the map can be initialised in a 0px canvas. The JQVMap
throws an exception like this:

jquery.vmap.min.js:10 Error: <g> attribute transform: Trailing garbage, "…0) translate(0, Infinity)".

When it is initialised in a 0px canvas, the scale calculus provides a
scale of 0. When the scale of 0 is applyed on SVG, it perform a divide
by 0 which returns infinite. The SVG translate attribute expect number.
It receives "Infinity".

Fix:

I proposes the attached patch which check scale == 0 and force 1. I tested it and it work, and I check grunt build.

0001-Bug-Minor-revent-divide-by-0.patch.txt

Thierry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants