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:
Joshua Granick
2016-06-16 14:30:32 -07:00
committed by GitHub
2 changed files with 5 additions and 2 deletions

View File

@@ -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);
}

View File

@@ -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);
}