From 02bfb3e35a1fe5ca2dbb759bcfb60725337ea316 Mon Sep 17 00:00:00 2001 From: Haven1433 Date: Thu, 16 Dec 2021 20:04:23 -0600 Subject: [PATCH] Use the correct palette for 1-bit and 2-bit sprites (footprints and fonts) --- src/HexManiac.Core/ViewModels/ImageEditorViewModel.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/HexManiac.Core/ViewModels/ImageEditorViewModel.cs b/src/HexManiac.Core/ViewModels/ImageEditorViewModel.cs index e201152c..20e76ce9 100644 --- a/src/HexManiac.Core/ViewModels/ImageEditorViewModel.cs +++ b/src/HexManiac.Core/ViewModels/ImageEditorViewModel.cs @@ -431,8 +431,8 @@ namespace HavenSoft.HexManiac.Core.ViewModels { var spriteRun = inputRun as ISpriteRun; var palRun = inputRun as IPaletteRun; if (spriteRun == null) spriteRun = palRun.FindDependentSprites(model).First(); - if (palRun == null) palRun = spriteRun.FindRelatedPalettes(model).FirstOrDefault(); - if (palRun == null) palRun = model.GetNextRun(toolPaletteAddress) as IPaletteRun; + if (palRun == null && spriteRun.SpriteFormat.BitsPerPixel > 2) palRun = spriteRun.FindRelatedPalettes(model).FirstOrDefault(); + if (palRun == null && spriteRun.SpriteFormat.BitsPerPixel > 2) palRun = model.GetNextRun(toolPaletteAddress) as IPaletteRun; SpritePointer = spriteRun.PointerSources[0]; PalettePointer = palRun?.PointerSources[0] ?? Pointer.NULL; Palette = new PaletteCollection(this, model, history) {