mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-12 21:05:36 +00:00
Round instead of truncating when converting a percentage color into aninteger. Bug 340613, r+sr=dbaron
This commit is contained in:
parent
230cf21323
commit
b952d0f1fb
@ -3052,7 +3052,7 @@ PRBool CSSParserImpl::ParseColorComponent(nsresult& aErrorCode,
|
||||
if (ExpectSymbol(aErrorCode, aStop, PR_TRUE)) {
|
||||
if (value < 0.0f) value = 0.0f;
|
||||
if (value > 255.0f) value = 255.0f;
|
||||
aComponent = (PRUint8) value;
|
||||
aComponent = NSToIntRound(value);
|
||||
return PR_TRUE;
|
||||
}
|
||||
const PRUnichar stopString[] = { PRUnichar(aStop), PRUnichar(0) };
|
||||
|
Loading…
Reference in New Issue
Block a user