stuff-from-scratch/apps/notes_tk/canvas/CanvasDrawingArea.h
2023-12-21 09:18:44 +00:00

29 lines
626 B
C++

#pragma once
#include "Widget.h"
#include "CanvasElements.h"
class GeometryNode;
class CanvasDrawingArea : public Widget
{
public:
~CanvasDrawingArea();
void setActiveDrawingCommand(CanvasDrawCommand command)
{
mActiveDrawingCommand = command;
}
private:
bool isDirty() const override;
void doPaint(const PaintEvent* event) override;
void onMyMouseEvent(const MouseEvent* event) override;
void addShapeAt(unsigned x, unsigned y);
CanvasDrawCommand mActiveDrawingCommand{CanvasDrawCommand::LINE};
Vector<Ptr<GeometryNode> > mSceneNodes;
bool mContentDirty{false};
};