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

Include a viewBox attribute in the SVG tag to improve compatibility. #28

Open
ghost opened this issue Aug 30, 2018 · 1 comment
Open
Milestone

Comments

@ghost
Copy link

ghost commented Aug 30, 2018

Do you want to request a feature or report a bug?
Feature

If this is a feature request, what is motivation for changing the behavior?
Increase SVG compatibility to allow CSS styling by including the viewBox attribute.

What is the current behavior?
Generating an SVG captcha results in the following SVG tag without viewBox:

<svg xmlns="http://www.w3.org/2000/svg" width="${width}" height="${height}">

What is the expected behavior?
Generating an SVG captcha should also include a viewBox:

<svg xmlns="http://www.w3.org/2000/svg" width="${width}" height="${height}" viewBox="0,0,${width},${height}">

Step to reproduce the bug or other relevant information
The line lib/index.js:75 should be updated to include a viewBox attribute. This allows CSS rules like width: auto and height: auto to be applied. This non-breaking change furthermore allows the captcha to cover or be contained in a parent div by applying the css object-fit property.

@lichaozhy lichaozhy added this to the 3.x milestone Oct 27, 2018
@lichaozhy
Copy link
Member

I am very sorry. I had fixed it in v1.3.12. I've been busy designing v3.x to solve the problems thoroughly but more time need. The new release will solve a series of problems and provide more graceful APIs.

Keep in touch if you have any questions. Thanks for your support especially from you.

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

No branches or pull requests

1 participant