mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
Incorporating FIX to Image copy on subimage + method to reset alpha.
Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
This commit is contained in:
@@ -91,7 +91,7 @@ public final class CardPicturePanel extends JPanel implements ImageFetcher.Callb
|
||||
if (displayed instanceof PaperCard) {
|
||||
ColorModel cm = image.getColorModel();
|
||||
boolean isAlphaPremultiplied = cm.isAlphaPremultiplied();
|
||||
WritableRaster raster = image.copyData(null);
|
||||
WritableRaster raster = image.copyData(image.getRaster().createCompatibleWritableRaster());
|
||||
final BufferedImage displayedimage = new BufferedImage(cm, raster, isAlphaPremultiplied, null)
|
||||
.getSubimage(0, 0, image.getWidth(), image.getHeight());
|
||||
this.currentImage = displayedimage;
|
||||
@@ -150,4 +150,8 @@ public final class CardPicturePanel extends JPanel implements ImageFetcher.Callb
|
||||
public void showAsDisabled(){
|
||||
this.panel.setAlpha(0.5f);
|
||||
}
|
||||
|
||||
public void showAsEnabled(){
|
||||
this.panel.setAlpha(0.0f);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user