Complete canvas state snapshot. More...
#include <canvas_state.h>
Public Member Functions | |
CanvasState ()=default | |
CanvasState (const std::string &id) | |
Public Attributes | |
std::string | canvas_id = "Canvas" |
std::string | context_id = "CanvasContext" |
CanvasConfig | config |
CanvasSelection | selection |
CanvasGeometry | geometry |
ImVec2 | mouse_pos_in_canvas = ImVec2(0, 0) |
ImVec2 | drawn_tile_pos = ImVec2(-1, -1) |
bool | is_hovered = false |
ImVector< ImVec2 > | points |
ImVector< ImVector< std::string > > | labels |
int | current_labels = 0 |
int | highlight_tile_id = -1 |
Complete canvas state snapshot.
Aggregates all canvas state into a single POD for easier refactoring and testing. Designed to replace the scattered state members in the Canvas class gradually.
Usage Pattern:
Definition at line 43 of file canvas_state.h.
|
default |
|
inlineexplicit |
Definition at line 71 of file canvas_state.h.
std::string yaze::gui::CanvasState::canvas_id = "Canvas" |
Definition at line 45 of file canvas_state.h.
std::string yaze::gui::CanvasState::context_id = "CanvasContext" |
Definition at line 46 of file canvas_state.h.
CanvasConfig yaze::gui::CanvasState::config |
Definition at line 49 of file canvas_state.h.
CanvasSelection yaze::gui::CanvasState::selection |
Definition at line 52 of file canvas_state.h.
CanvasGeometry yaze::gui::CanvasState::geometry |
Definition at line 55 of file canvas_state.h.
Referenced by yaze::gui::Canvas::DrawBackground(), yaze::gui::Canvas::DrawBitmap(), yaze::gui::Canvas::DrawBitmap(), and yaze::gui::Canvas::DrawBitmap().
ImVec2 yaze::gui::CanvasState::mouse_pos_in_canvas = ImVec2(0, 0) |
Definition at line 58 of file canvas_state.h.
Referenced by yaze::gui::Canvas::DrawBackground().
ImVec2 yaze::gui::CanvasState::drawn_tile_pos = ImVec2(-1, -1) |
Definition at line 59 of file canvas_state.h.
bool yaze::gui::CanvasState::is_hovered = false |
Definition at line 60 of file canvas_state.h.
Referenced by yaze::gui::Canvas::DrawBackground().
ImVector<ImVec2> yaze::gui::CanvasState::points |
Definition at line 63 of file canvas_state.h.
ImVector<ImVector<std::string> > yaze::gui::CanvasState::labels |
Definition at line 64 of file canvas_state.h.
int yaze::gui::CanvasState::current_labels = 0 |
Definition at line 65 of file canvas_state.h.
int yaze::gui::CanvasState::highlight_tile_id = -1 |
Definition at line 66 of file canvas_state.h.