|
FuncDoodle
|
Handles canvas editing, painting tools, and stroke recording. More...
#include <EditorController.h>
Classes | |
| struct | CanvasContext |
| Bundles per-frame canvas state used during rendering and input handling. More... | |
Public Member Functions | |
| EditorController () | |
| Creates an editor controller. | |
| bool | Paint (Frame *frame, unsigned long frameI, ToolManager *toolManager, AnimationPlayer *player, int pixelX, int pixelY, bool mouseDown, bool mouseClicked) |
| Applies the active tool to a frame at a specific pixel. | |
| void | SetUndoByStroke (bool undoByStroke, AnimationPlayer *player) |
| Enables or disables stroke-grouped undo behavior. | |
| void | RenderCanvas (CanvasContext &context) |
| Renders the frame canvas and handles its live interaction. | |
| void | EndStroke (AnimationPlayer *player) |
| Finalizes the active stroke and pushes its undo record. | |
| void | ResetState () |
| Clears transient editor state tied to the active project. | |
| SharedPtr< Selection > | Sel () |
| Returns the active selection object. | |
Private Member Functions | |
| bool | PaintPencil (Frame *frame, unsigned long frameI, ToolManager *toolManager, AnimationPlayer *player, int pixelX, int pixelY, bool mouseDown) |
| bool | PaintEraser (Frame *frame, unsigned long frameI, ToolManager *toolManager, AnimationPlayer *player, int pixelX, int pixelY, bool mouseDown) |
| bool | PaintBucket (Frame *frame, unsigned long frameI, ToolManager *toolManager, AnimationPlayer *player, int pixelX, int pixelY, bool mouseClicked) |
| bool | PaintSelect (Frame *frame, ToolManager *toolManager, int pixelX, int pixelY) |
| void | RecordStrokeChange (unsigned long frameI, int x, int y, const Col &prev, const Col &next) |
| void | ApplyToolAt (CanvasContext &context, const ImageArray *pixels, float startX, float startY, float frameWidth, float frameHeight) |
| void | DrawCanvas (CanvasContext &context, const ImageArray *pixels, ImDrawList *drawList, float startX, float startY, float frameWidth, float frameHeight) |
| void | FinalizeStroke (AnimationPlayer *player) |
Static Private Member Functions | |
| static bool | PaintPicker (Frame *frame, ToolManager *toolManager, int pixelX, int pixelY) |
| static void | FloodFill (int x, int y, Col targetCol, Col fillCol, Frame *targetFrame, std::vector< std::pair< int, int > > &changed) |
| static void | HandleCanvasInput (CanvasContext &context) |
Private Attributes | |
| bool | m_UndoByStroke = false |
| bool | m_StrokeActive = false |
| unsigned long | m_StrokeFrameI = 0 |
| std::vector< StrokeAction::PixelChange > | m_StrokeChanges |
| std::unordered_map< unsigned long long, size_t > | m_StrokeIndexByKey |
| SharedPtr< Selection > | m_Sel |
| SquareSelection | m_SquareSel |
Handles canvas editing, painting tools, and stroke recording.
Bridges canvas input, tool execution, and frame mutation logic.
|
default |
Creates an editor controller.
|
private |
|
private |
| void FuncDoodle::EditorController::EndStroke | ( | AnimationPlayer * | player | ) |
Finalizes the active stroke and pushes its undo record.
| player | Player providing access to the current project. |
|
private |
|
staticprivate |
|
staticprivate |
| bool FuncDoodle::EditorController::Paint | ( | Frame * | frame, |
| unsigned long | frameI, | ||
| ToolManager * | toolManager, | ||
| AnimationPlayer * | player, | ||
| int | pixelX, | ||
| int | pixelY, | ||
| bool | mouseDown, | ||
| bool | mouseClicked ) |
Applies the active tool to a frame at a specific pixel.
| frame | Frame being edited. |
| frameI | Frame index within the project. |
| toolManager | Tool state and color source. |
| player | Animation player for project access. |
| pixelX | Target pixel X coordinate. |
| pixelY | Target pixel Y coordinate. |
| mouseDown | Whether the primary mouse button is held. |
| mouseClicked | Whether the primary mouse button was clicked this frame. |
|
private |
|
private |
|
private |
|
staticprivate |
|
private |
|
private |
| void FuncDoodle::EditorController::RenderCanvas | ( | CanvasContext & | context | ) |
Renders the frame canvas and handles its live interaction.
| context | Canvas state for the frame being rendered. |
| void FuncDoodle::EditorController::ResetState | ( | ) |
Clears transient editor state tied to the active project.
Returns the active selection object.
| void FuncDoodle::EditorController::SetUndoByStroke | ( | bool | undoByStroke, |
| AnimationPlayer * | player ) |
Enables or disables stroke-grouped undo behavior.
| undoByStroke | Whether strokes should become single undo entries. |
| player | Player providing project access for flushing active strokes. |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |