зеркало из https://github.com/mozilla/pjs.git
bug 329593, canvas returned .fillStyle string doesn't follow the spec when it's in rgba notation. Patch by asqueella@gmail.com, r+sr=vlad
This commit is contained in:
Родитель
27473df324
Коммит
d5b7ae0be7
|
@ -609,11 +609,14 @@ nsCanvasRenderingContext2D::StyleColorToString(const nscolor& aColor, nsAString&
|
|||
NS_GET_B(aColor)),
|
||||
aStr);
|
||||
} else {
|
||||
CopyUTF8toUTF16(nsPrintfCString(100, "rgba(%d,%d,%d,%0.2f)",
|
||||
// "%0.5f" in nsPrintfCString would use the locale-specific
|
||||
// decimal separator. That's why we have to do this:
|
||||
PRUint32 alpha = NS_GET_A(aColor) * 100000 / 255;
|
||||
CopyUTF8toUTF16(nsPrintfCString(100, "rgba(%d, %d, %d, 0.%d)",
|
||||
NS_GET_R(aColor),
|
||||
NS_GET_G(aColor),
|
||||
NS_GET_B(aColor),
|
||||
NS_GET_A(aColor) / 255.0f),
|
||||
alpha),
|
||||
aStr);
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче