[r112] Opacity Comparison Glitch

Bugs will be moved here once resolved.

Post » Wed Dec 12, 2012 11:10 am

I've been coding around this glitch for a few weeks now, so here it is: if you test an opacity number, sometimes it turns out false when it shouldn't, for example 7=7 or 15=15. Funny thing, it seems to follow a pattern.

From my tests, opacity start at 0 going up, the numbers that always come out false are 7, 14, 15, and 28 through 100. When opacity starts at 100 going down, these numbers are 58 - 0. If I start at 0 and skip 2 going up, they're 14, 28, 30, and 56 - 100.

Here is the download link to a sample .capx I made. One sprite, one text that keeps track of its opacity, and another text that checks the opacity and increases it if true.

I get the same results every time, on the most recent IE, Firefox, and Chrome browsers. I have a Windows 7 laptop, Mobile Intel(R) 4 Series Express Chipset Family graphics card (chipset) which is up-to-date.
B
19
S
5
G
1
Posts: 104
Reputation: 2,920

Post » Wed Dec 12, 2012 3:05 pm

Should be fixed in the next build, was caused by a floating point rounding error. Internally opacities are stored as 0-1, so they're multiplied by 100 to get the C2 value... and it turns out 0.06 x 100 = 6, but 0.07 x 100 = 7.0000000001!
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 0 guests