[view] fix ImageView color
This commit is contained in:
@@ -15,6 +15,7 @@ class ImageView extends SpriteView {
|
||||
public var fillType(default, set):FillType;
|
||||
|
||||
private var bitmapSkin:BitmapSkin = new BitmapSkin();
|
||||
private var coloredImage:BitmapData;
|
||||
|
||||
public function new(image:BitmapData = null) {
|
||||
super();
|
||||
@@ -34,9 +35,9 @@ class ImageView extends SpriteView {
|
||||
if (image != value) {
|
||||
image = value;
|
||||
if (color > -1) {
|
||||
image = BitmapUtil.colorize(image, color);
|
||||
coloredImage = BitmapUtil.colorize(image, color);
|
||||
}
|
||||
bitmapSkin.image = image;
|
||||
bitmapSkin.image = coloredImage == null ? image : coloredImage;
|
||||
toRedraw();
|
||||
}
|
||||
return image;
|
||||
@@ -64,9 +65,10 @@ class ImageView extends SpriteView {
|
||||
if (color != value) {
|
||||
color = value;
|
||||
if (image != null) {
|
||||
image = BitmapUtil.colorize(image, color);
|
||||
toRedraw();
|
||||
coloredImage = BitmapUtil.colorize(image, color);
|
||||
bitmapSkin.image = coloredImage;
|
||||
}
|
||||
toRedraw();
|
||||
}
|
||||
return color;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user