[nostalgia/core] Add Fill command to tilesheet editor and make ClipboardObject more efficient

This commit is contained in:
2022-03-11 20:41:36 -06:00
parent ae80d22769
commit 7df978605f
7 changed files with 391 additions and 337 deletions

View File

@@ -56,7 +56,7 @@ void TileSheetEditorImGui::draw(core::Context*) noexcept {
{
ImGui::BeginChild("ToolBox", ImVec2(m_palViewWidth - 24, 30), true);
{
const auto btnSz = ImVec2(40, 14);
const auto btnSz = ImVec2(45, 14);
if (ImGui::Selectable("Draw", m_tool == Tool::Draw, 0, btnSz)) {
m_tool = Tool::Draw;
model()->clearSelection();
@@ -65,6 +65,11 @@ void TileSheetEditorImGui::draw(core::Context*) noexcept {
if (ImGui::Selectable("Select", m_tool == Tool::Select, 0, btnSz)) {
m_tool = Tool::Select;
}
ImGui::SameLine();
if (ImGui::Selectable("Fill", m_tool == Tool::Fill, 0, btnSz)) {
m_tool = Tool::Fill;
model()->clearSelection();
}
}
ImGui::EndChild();
const auto ySize = paneSize.y - 36;
@@ -212,10 +217,13 @@ void TileSheetEditorImGui::drawTileSheet(const geo::Vec2 &fbSize) noexcept {
m_tileSheetEditor.clickDraw(fbSize, clickPos);
break;
case Tool::Fill:
case Tool::None:
m_tileSheetEditor.clickFill(fbSize, clickPos);
break;
case Tool::Select:
m_tileSheetEditor.clickSelect(fbSize, clickPos);
break;
case Tool::None:
break;
}
}
}