From a8a5aa7d3cb0e64205d9ddc610293e5a2edb161b Mon Sep 17 00:00:00 2001 From: counter185 <33550839+counter185@users.noreply.github.com> Date: Sat, 15 Jun 2024 22:23:42 +0200 Subject: [PATCH] bandaid fix layer picker :skull::skull: --- freesprite/EditorLayerPicker.cpp | 3 ++- freesprite/FileIO.cpp | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/freesprite/EditorLayerPicker.cpp b/freesprite/EditorLayerPicker.cpp index 40c3bd1..31e1455 100644 --- a/freesprite/EditorLayerPicker.cpp +++ b/freesprite/EditorLayerPicker.cpp @@ -65,7 +65,8 @@ EditorLayerPicker::~EditorLayerPicker() bool EditorLayerPicker::isMouseIn(XY thisPositionOnScreen, XY mousePos) { - return pointInBox(mousePos, SDL_Rect{ thisPositionOnScreen.x, thisPositionOnScreen.y, wxWidth, wxHeight }); + return pointInBox(mousePos, SDL_Rect{ thisPositionOnScreen.x, thisPositionOnScreen.y, wxWidth, wxHeight }) + || layerButtons.mouseInAny(thisPositionOnScreen, mousePos); } void EditorLayerPicker::render(XY position) diff --git a/freesprite/FileIO.cpp b/freesprite/FileIO.cpp index 42d33d1..ccf165b 100644 --- a/freesprite/FileIO.cpp +++ b/freesprite/FileIO.cpp @@ -1383,6 +1383,7 @@ MainEditor* readVOIDSN(PlatformNativePathString path) for (int x = 0; x < nlayers && x < layerVisibilityData.size(); x++) { ret->layers[x]->hidden = layerVisibilityData[x] == '0'; } + ret->layerPicker->updateLayers(); } if (extData.contains("comments")) { std::string commentsData = extData["comments"];