Merge pull request #761 from azrafe7/fillrectalpha-dev
Fix fillRect behaviour when using alpha on neko/cpp (see #759 and #631)
This commit is contained in:
@@ -333,6 +333,7 @@ class ImageDataUtil {
|
||||
|
||||
var format = image.buffer.format;
|
||||
var premultiplied = image.buffer.premultiplied;
|
||||
if (premultiplied) fillColor.multiplyAlpha();
|
||||
|
||||
var dataView = new ImageDataView (image, rect);
|
||||
var row;
|
||||
@@ -343,7 +344,7 @@ class ImageDataUtil {
|
||||
|
||||
for (x in 0...dataView.width) {
|
||||
|
||||
fillColor.writeUInt8 (data, row + (x * 4), format, premultiplied);
|
||||
fillColor.writeUInt8 (data, row + (x * 4), format, false);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -253,13 +253,15 @@ namespace lime {
|
||||
int row;
|
||||
RGBA fillColor (color);
|
||||
|
||||
if (premultiplied) fillColor.MultiplyAlpha ();
|
||||
|
||||
for (int y = 0; y < dataView.height; y++) {
|
||||
|
||||
row = dataView.Row (y);
|
||||
|
||||
for (int x = 0; x < dataView.width; x++) {
|
||||
|
||||
fillColor.WriteUInt8 (data, row + (x * 4), format, premultiplied);
|
||||
fillColor.WriteUInt8 (data, row + (x * 4), format, false);
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user