Skip to content
This repository has been archived by the owner on Apr 20, 2023. It is now read-only.

Divide-by-zero error in linear-gradient code #30

Closed
lojjic opened this issue Jul 15, 2010 · 6 comments
Closed

Divide-by-zero error in linear-gradient code #30

lojjic opened this issue Jul 15, 2010 · 6 comments

Comments

@lojjic
Copy link
Owner

lojjic commented Jul 15, 2010

See forum posting http://css3pie.com/forum/viewtopic.php?f=3&t=4 -- there is a divide-by-zero error when the element has dimensions of zero.

We should probably avoid performing any rendering whatsoever when the element has no dimensions.

@lojjic
Copy link
Owner Author

lojjic commented Jul 18, 2010

Also see issue #39 -- this error is reproducible by setting a PIE element's ancestor to display:none.

@timoxley
Copy link

This issue shouldn't be closed as the error still occurs (and is particularly irritating).

@lojjic
Copy link
Owner Author

lojjic commented Nov 25, 2010

You're using the most recent code from GitHub and still seeing this? Can you post a testcase?

@hdaley
Copy link

hdaley commented Jan 29, 2011

Problem occurring also at line 3133 of the uncompressed .htc when applied to element with no dimensions (display: none)

@hdaley
Copy link

hdaley commented Jan 29, 2011

Plastered over with the following kludge replacement for line 3133; works in my situation but not sure if would work generally:

if (w > 0 && h > 0) {fill.position = (0.5 / w) + ',' + (0.5 / h)} else {fill.position = '0,0'};

@lojjic
Copy link
Owner Author

lojjic commented Jan 29, 2011

This has already been fixed in the latest code: a76770d

gucong3000 pushed a commit to gucong3000/PIE that referenced this issue Apr 22, 2016
… or height of zero; this prevents a divide-by-zero error in the background-image position calculation and has a performance benefit as well. Fixes issue lojjic#30.
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants