yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::gui::CanvasState Struct Reference

Complete canvas state snapshot. More...

#include <canvas_state.h>

Collaboration diagram for yaze::gui::CanvasState:

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
 

Detailed Description

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:

  • Geometry recalculated every frame in DrawBackground()
  • Configuration updated via user interaction
  • Selection state modified by interaction handlers
  • Drawing state (points, labels) updated during rendering

Definition at line 43 of file canvas_state.h.

Constructor & Destructor Documentation

◆ CanvasState() [1/2]

yaze::gui::CanvasState::CanvasState ( )
default

◆ CanvasState() [2/2]

yaze::gui::CanvasState::CanvasState ( const std::string &  id)
inlineexplicit

Definition at line 71 of file canvas_state.h.

Member Data Documentation

◆ canvas_id

std::string yaze::gui::CanvasState::canvas_id = "Canvas"

Definition at line 45 of file canvas_state.h.

◆ context_id

std::string yaze::gui::CanvasState::context_id = "CanvasContext"

Definition at line 46 of file canvas_state.h.

◆ config

CanvasConfig yaze::gui::CanvasState::config

Definition at line 49 of file canvas_state.h.

◆ selection

CanvasSelection yaze::gui::CanvasState::selection

Definition at line 52 of file canvas_state.h.

◆ geometry

◆ mouse_pos_in_canvas

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().

◆ drawn_tile_pos

ImVec2 yaze::gui::CanvasState::drawn_tile_pos = ImVec2(-1, -1)

Definition at line 59 of file canvas_state.h.

◆ is_hovered

bool yaze::gui::CanvasState::is_hovered = false

Definition at line 60 of file canvas_state.h.

Referenced by yaze::gui::Canvas::DrawBackground().

◆ points

ImVector<ImVec2> yaze::gui::CanvasState::points

Definition at line 63 of file canvas_state.h.

◆ labels

ImVector<ImVector<std::string> > yaze::gui::CanvasState::labels

Definition at line 64 of file canvas_state.h.

◆ current_labels

int yaze::gui::CanvasState::current_labels = 0

Definition at line 65 of file canvas_state.h.

◆ highlight_tile_id

int yaze::gui::CanvasState::highlight_tile_id = -1

Definition at line 66 of file canvas_state.h.


The documentation for this struct was generated from the following file: