From c00de3eeeeff2ad0326abf7c87d81a7a9e6e9c15 Mon Sep 17 00:00:00 2001 From: Juan Segura Date: Sun, 17 Nov 2024 12:50:37 +0100 Subject: [PATCH] Sprite editor: bug exporting attributes --- .../DocumentEditors/ZXGraphics/SpriteEditor.axaml.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ZXBStudio/DocumentEditors/ZXGraphics/SpriteEditor.axaml.cs b/ZXBStudio/DocumentEditors/ZXGraphics/SpriteEditor.axaml.cs index d981a38..87c8f15 100644 --- a/ZXBStudio/DocumentEditors/ZXGraphics/SpriteEditor.axaml.cs +++ b/ZXBStudio/DocumentEditors/ZXGraphics/SpriteEditor.axaml.cs @@ -293,6 +293,16 @@ private void _Initialize(string fileName) } } */ + // Check attributes for ZX Spectrum mode + if (sprite != null && sprite.Patterns != null) + { + var al = (sprite.Width / 8) * (sprite.Height / 8); + foreach (var pattern in sprite.Patterns) + { + pattern.Attributes = pattern.Attributes.Take(al).ToArray(); + } + } + // Create pattern list var spc = new SpritePatternControl(); spc.Initialize(sprite, SpriteList_Command);