Canvas windows, settings and manager: share view code and list I/O

- CanvasView base holds checker pan sync, zoom step, grid panel, view buttons and view context menu
- frame_parent_model_get replaces five root/group transform compositions
- Canvas builds VAOs through one helper, unifies uniform setters and frees the texture VAO/VBO/EBO (leak fix)
- Settings load/save loop over component suffix tables; unused settings Type enum removed
- Manager shares one path-list load/save for recent and autosave files
- Anonymous namespaces removed per project style

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shweetandClaude Opus 5.5 committed 2026-10-03 13:50:13 -04:00
1 parent a4638a422d
commit ec72a30ce0
16 files changed
+558 -814

No files matched your search

+34
View File
@@ -0,0 +1,34 @@
#pragma once
#include <functional>
#include "canvas.hpp"
#include "manager.hpp"
#include "settings.hpp"
namespace anm2ed::imgui
{
class CanvasView : public Canvas
{
protected:
glm::vec2 mousePos{};
glm::vec2 checkerPan{};
glm::vec2 checkerSyncPan{};
float checkerSyncZoom{};
bool isCheckerPanInitialized{};
bool hasPendingZoomPanAdjust{};
bool isFocused{};
void checker_pan_reset(float, glm::vec2);
void checker_pan_sync(float, glm::vec2);
void zoom_step(float&, glm::vec2&, glm::vec2, int);
void grid_child_draw(ImVec2, bool&, glm::vec4&, glm::ivec2&, glm::ivec2&, bool* = nullptr);
void view_buttons_draw(Manager&, Settings&, const std::function<void()>&, const std::function<void()>&);
void view_context_menu_draw(const char*, Manager&, Settings&, Document&, float&, glm::vec2&,
const std::function<void()>&, const std::function<void()>&, bool);
public:
CanvasView();
bool is_focused_get() const;
};
}