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

Value point with percentage and px #16

Closed
gilangpramudya opened this issue Jan 27, 2016 · 2 comments
Closed

Value point with percentage and px #16

gilangpramudya opened this issue Jan 27, 2016 · 2 comments

Comments

@gilangpramudya
Copy link

Hi, Mate

I like your plugin, but i have a question. I'm in case with value points, this is my value (0 60px,100% 0,100% 100%,0 100%); i'm use pixel because need accurate size on polygon but i'm use percentage too.
So how to put point in your plugin?

Thanks

@andrusieczko
Copy link
Owner

Hi,

I'm sorry for not responding, I've been traveling.

That's a valid point, I'll try to look at your issue this week. I'll try to alter the library the that accepts mixed values.

Not sure if Firefox likes that though. I'll keep you updated.

Thanks for this issue,
Karol

@andrusieczko
Copy link
Owner

Hi,

So I checked the browser support and unfortunately,Firefox's Gecko engine still doesn't support this...
Here's the thread: https://bugzilla.mozilla.org/show_bug.cgi?id=1075457

So Chrome and any webkit based browsers support clip-path as a basic style (in CSS). Gecko engines need SVG clip-path definition.

In SVG clip-path, there are only two types of units you can use: userSpaceOnUse and objectBoundingBox (https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/clipPathUnits).
Long story short, userSpaceOnUse is used when you pass the absolute values and objectBoundingBox requires normalized values between 0 and 1, so it's handy when dealing with percents.

Unfortunately, SVG doesn't support mixing the units, so it is technically impossible to make it happen, albeit the code proposal has been recently sent.

Thus, I'm not sure if adding this option won't be confusing (as it'd work only in webkit browsers).

I'd like to hear your opinion on this.

Cheers,
Karol

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

2 participants