[nostalgia/core/studio] Add scrolling support to TileSheetEditor

This commit is contained in:
2022-02-04 22:51:17 -06:00
parent 9af7eb2fd7
commit 96e2510e64
8 changed files with 183 additions and 62 deletions
@@ -100,13 +100,13 @@ class TileSheetEditor: public studio::Editor {
ox::String m_itemPath;
ox::String m_itemName;
glutils::FrameBuffer m_framebuffer;
TileSheetGrid m_pixelGrid;
TileSheetPixels m_pixels;
TileSheetGrid m_pixelGridDrawer;
TileSheetPixels m_pixelsDrawer;
bool m_updated = false;
NostalgiaGraphic m_img;
AssetRef<NostalgiaPalette> m_pal;
Context *m_ctx = nullptr;
float m_pixelSizeMod = 1;
ImVec2 m_scrollOffset;
public:
TileSheetEditor(Context *ctx, const ox::String &path);
@@ -132,6 +132,8 @@ class TileSheetEditor: public studio::Editor {
protected:
void saveItem() override;
void getFillPixels(bool *pixels, common::Point pt, int oldColor) const;
private:
void setPalette();
@@ -145,6 +147,8 @@ class TileSheetEditor: public studio::Editor {
[[nodiscard]]
ox::String palettePath(const ox::String &palettePath) const;
void clickPixel(const ImVec2 &paneSize, float x, float y) noexcept;
// slots
public:
ox::Error colorSelected() noexcept;