[nostalgia/core/studio] Fix issue with pixel idx lookup in draw command

This commit is contained in:
2022-02-14 01:38:56 -06:00
parent 60e259ca34
commit 99cc853b94
4 changed files with 28 additions and 37 deletions

View File

@@ -87,7 +87,8 @@ void TileSheetEditorImGui::drawTileSheet(const geo::Vec2 &fbSize) noexcept {
if (wheelh != 0) {
m_tileSheetEditor.scrollH(fbSize, wheelh);
}
if (io.MouseDown[0]) {
if (io.MouseDown[0] && m_prevMouseDownPos != mousePos) {
m_prevMouseDownPos = mousePos;
auto clickPos = mousePos;
const auto &winPos = ImGui::GetWindowPos();
clickPos.x -= winPos.x + 10;
@@ -96,6 +97,7 @@ void TileSheetEditorImGui::drawTileSheet(const geo::Vec2 &fbSize) noexcept {
}
}
if (io.MouseReleased[0]) {
m_prevMouseDownPos = {-1, -1};
m_tileSheetEditor.releaseMouseButton();
}
}