mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-29 23:40:27 +00:00
Remove layer null check
Move to the place that triggered the null
This commit is contained in:
parent
a33120c93e
commit
80a5d8e451
2 changed files with 3 additions and 4 deletions
|
@ -16,10 +16,8 @@ namespace PKHeX.Drawing
|
|||
return LayerImage(baseLayer, overLayer, x, y);
|
||||
}
|
||||
|
||||
public static Bitmap LayerImage(Image? baseLayer, Image overLayer, int x, int y)
|
||||
public static Bitmap LayerImage(Image baseLayer, Image overLayer, int x, int y)
|
||||
{
|
||||
if (baseLayer is null)
|
||||
return (Bitmap)overLayer;
|
||||
Bitmap img = new Bitmap(baseLayer);
|
||||
using Graphics gr = Graphics.FromImage(img);
|
||||
gr.DrawImage(overLayer, x, y, overLayer.Width, overLayer.Height);
|
||||
|
|
|
@ -108,6 +108,7 @@ namespace PKHeX.WinForms.Controls
|
|||
frame = ImageUtil.GetBitmap(frameData, imgWidth, imgHeight);
|
||||
if (ExtraLayer != null)
|
||||
frame = ImageUtil.LayerImage(frame, ExtraLayer, 0, 0);
|
||||
if (OriginalBackground != null)
|
||||
frame = ImageUtil.LayerImage(OriginalBackground, frame, 0, 0);
|
||||
return GlowCache[frameIndex] = frame;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue