yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::editor::PixelEditorPanel Class Reference

Main pixel editing panel for graphics sheets. More...

#include <pixel_editor_panel.h>

Inheritance diagram for yaze::editor::PixelEditorPanel:

Public Member Functions

 PixelEditorPanel (GraphicsEditorState *state, Rom *rom, UndoManager *undo_manager=nullptr)
 
std::string GetId () const override
 Unique identifier for this panel.
 
std::string GetDisplayName () const override
 Human-readable name shown in menus and title bars.
 
std::string GetIcon () const override
 Material Design icon for this panel.
 
std::string GetEditorCategory () const override
 Editor category this panel belongs to.
 
int GetPriority () const override
 Get display priority for menu ordering.
 
void Initialize ()
 Initialize the panel.
 
void SetRom (Rom *rom)
 
void SetSourcePreviewCallback (std::function< void()> draw)
 
void ShowSourcePreview ()
 
void SetSheetBrowserCallbacks (std::function< bool()> visible, std::function< void(bool)> set_visible)
 
void Draw (bool *p_open) override
 Draw the pixel editor UI (WindowContent interface)
 
absl::Status Update ()
 Legacy Update method for backward compatibility.
 
void CopyToSystemClipboard ()
 
void CutToSystemClipboard ()
 
void PasteFromSystemClipboard ()
 
bool HasActiveStroke () const
 
void FinishGesture ()
 
void FinishReleasedGesture ()
 
void SetHistoryCallbacks (std::function< absl::Status()> undo, std::function< absl::Status()> redo)
 
void SetPaletteReorderCallback (PaletteReorderControl::Apply apply)
 
- Public Member Functions inherited from yaze::editor::WindowContent
virtual ~WindowContent ()=default
 
virtual void OnFirstDraw ()
 Called once before the first Draw() in a session.
 
virtual bool RequiresLazyInit () const
 Whether this panel uses lazy initialization.
 
void InvalidateLazyInit ()
 Reset lazy init state so OnFirstDraw() runs again.
 
virtual void OnOpen ()
 Called when panel becomes visible.
 
virtual void OnClose ()
 Called when panel is hidden.
 
virtual void OnFocus ()
 Called when panel receives focus.
 
virtual WindowLifecycle GetWindowLifecycle () const
 Get the lifecycle category for this window.
 
virtual WindowContextScope GetContextScope () const
 Optional context binding for this window (room/selection/etc)
 
virtual WindowScope GetScope () const
 Get the registration scope for this window.
 
virtual WindowPresentationPolicy GetPresentationPolicy () const
 How this content is hosted and advertised by workspace chrome.
 
virtual bool IsEnabled () const
 Check if this panel is currently enabled.
 
virtual std::string GetDisabledTooltip () const
 Get tooltip text when panel is disabled.
 
virtual std::string GetShortcutHint () const
 Get keyboard shortcut hint for display.
 
virtual std::string GetWorkflowGroup () const
 Optional workflow group for hack-centric actions.
 
virtual std::string GetWorkflowLabel () const
 Optional workflow label for menus/command palette.
 
virtual std::string GetWorkflowDescription () const
 Optional workflow description for menus/command palette.
 
virtual int GetWorkflowPriority () const
 Optional workflow ordering priority (lower sorts first).
 
virtual float GetPreferredWidth () const
 Get preferred width for this panel (optional)
 
virtual bool HasExactPreferredWidth () const
 Whether GetPreferredWidth() is an exact content width.
 
virtual float GetPreferredHeight () const
 Get preferred height for this panel (optional)
 
virtual bool PrefersFloating () const
 
virtual bool PreferAutoHideTabBar () const
 Whether the dock node hosting this panel should auto-hide its tab bar.
 
virtual bool IsVisibleByDefault () const
 Whether this panel should be visible by default.
 
virtual std::string GetParentPanelId () const
 Get parent panel ID for cascade behavior.
 
virtual bool CascadeCloseChildren () const
 Whether closing this panel should close child panels.
 
void DrawWithLazyInit (bool *p_open)
 Execute lazy initialization if needed, then call Draw()
 

Private Member Functions

void DrawSourceContext ()
 
gfx::Bitmap & DisplaySheet ()
 
gfx::SnesPalette DisplayPalette () const
 
void DrawToolbar ()
 Draw the toolbar with tool selection.
 
void DrawViewControls ()
 Draw zoom and view controls.
 
void DrawCanvas ()
 Draw the main editing canvas.
 
void DrawColorPicker ()
 Draw the color palette picker.
 
void DrawStatusBar ()
 Draw the status bar with cursor position.
 
void DrawMiniMap ()
 Draw the mini navigation map.
 
void HandleCanvasInput ()
 Handle canvas mouse input for current tool.
 
void ApplyPencil (int x, int y)
 Apply pencil tool at position.
 
void ApplyBrush (int x, int y)
 Apply brush tool at position.
 
void ApplyEraser (int x, int y)
 Apply eraser tool at position.
 
void ApplyFill (int x, int y)
 Apply flood fill starting at position.
 
void ApplyEyedropper (int x, int y)
 Apply eyedropper tool at position.
 
void DrawLine (int x1, int y1, int x2, int y2)
 Draw line from start to end.
 
void DrawRectangle (int x1, int y1, int x2, int y2, bool filled)
 Draw rectangle from start to end.
 
void BeginSelection (int x, int y)
 Start a new selection.
 
void UpdateSelection (int x, int y)
 Update selection during drag.
 
void EndSelection ()
 Finalize the selection.
 
void CopySelection ()
 Copy selection to clipboard.
 
void PasteSelection (int x, int y)
 Paste clipboard at position.
 
void FlipSelectionHorizontal ()
 Flip selection horizontally.
 
void FlipSelectionVertical ()
 Flip selection vertically.
 
void BeginStroke ()
 Starts a stroke on the current sheet. Pixel writes go to the session's GraphicsSheetStore until EndStroke().
 
void EndStroke ()
 Ends the stroke: the sheet's store revision changes once and one GraphicsPixelEditAction (the changed pixels) is pushed for undo.
 
zelda3::GraphicsSheetStore::Edit * StrokeEdit ()
 
void ShowStrokeChanges (bool changed)
 After pixel writes: refresh the Arena copy and mark the sheet modified.
 
ImVec2 ScreenToPixel (ImVec2 screen_pos)
 Convert screen coordinates to pixel coordinates.
 
ImVec2 PixelToScreen (int x, int y)
 Convert pixel coordinates to screen coordinates.
 
void DrawTransparencyGrid (float canvas_width, float canvas_height)
 Draw checkerboard pattern for transparent pixels.
 
void DrawCursorCrosshair ()
 Draw crosshair at cursor position.
 
void DrawBrushPreview ()
 Draw brush size preview circle.
 
void DrawPixelInfoTooltip (const gfx::Bitmap &sheet)
 Draw tooltip with pixel information.
 
void DrawTileHighlight (const gfx::Bitmap &sheet)
 Draw a transient highlight for a target tile.
 
void HandleFloatingPasteKeys ()
 
void DrawClipboardControls ()
 
void DrawFloatingPaste ()
 
bool HandleFloatingPasteInput ()
 
void CommitFloatingPaste ()
 
void CancelFloatingPaste ()
 
void ClampFloatingPaste ()
 
SheetColors CurrentSheetColors () const
 
bool HandlePanInput ()
 
void DrawPaletteRowPicker ()
 
void DrawPixelGrids (float canvas_width, float canvas_height)
 

Private Attributes

std::function< absl::Status()> undo_
 
std::function< absl::Status()> redo_
 
std::string history_error_
 
PixelTool gesture_tool_ = PixelTool::kPencil
 
PaletteReorderControl palette_reorder_
 
PaletteReorderControl::Apply apply_palette_reorder_
 
gfx::Bitmap context_sheet_
 
bool fit_canvas_requested_ = false
 
bool show_source_preview_ = true
 
std::function< void()> draw_source_preview_
 
std::function< bool()> sheet_browser_visible_
 
std::function< void(bool)> set_sheet_browser_visible_
 
GraphicsEditorState * state_
 
Rom * rom_
 
UndoManager * undo_manager_ = nullptr
 
gui::Canvas canvas_
 
std::optional< zelda3::GraphicsSheetStore::Edit > stroke_
 
bool is_drawing_ = false
 
ImVec2 last_mouse_pixel_ = {-1, -1}
 
ImVec2 tool_start_pixel_ = {-1, -1}
 
bool show_tool_preview_ = false
 
ImVec2 preview_end_ = {0, 0}
 
int cursor_x_ = 0
 
int cursor_y_ = 0
 
bool cursor_in_canvas_ = false
 
std::string clipboard_status_
 
bool clipboard_status_is_error_ = false
 
bool paste_skip_color0_ = false
 
bool dragging_paste_ = false
 
int paste_drag_dx_ = 0
 
int paste_drag_dy_ = 0
 

Friends

class PixelEditorPanelTestPeer
 
class AuthoringSaveWorkflowTestPeer
 

Additional Inherited Members

- Protected Member Functions inherited from yaze::editor::WindowContent
void InvalidateCache ()
 Invalidate all cached computations.
 
template<typename T >
T & GetCached (const std::string &key, std::function< T()> compute)
 Get or compute a cached value.
 
bool IsCacheValid () const
 Check if cache has been invalidated.
 
void ClearCache ()
 Clear all cached values (more aggressive than InvalidateCache)
 

Detailed Description

Main pixel editing panel for graphics sheets.

Provides a full-featured pixel editor with tools for drawing, selecting, and manipulating graphics data.

Definition at line 28 of file pixel_editor_panel.h.

Constructor & Destructor Documentation

◆ PixelEditorPanel()

yaze::editor::PixelEditorPanel::PixelEditorPanel ( GraphicsEditorState * state,
Rom * rom,
UndoManager * undo_manager = nullptr )
inlineexplicit

Definition at line 30 of file pixel_editor_panel.h.

Member Function Documentation

◆ GetId()

std::string yaze::editor::PixelEditorPanel::GetId ( ) const
inlineoverridevirtual

Unique identifier for this panel.

Returns
Panel ID in format "{category}.{name}" (e.g., "dungeon.room_selector")

IDs should be:

  • Lowercase with underscores
  • Prefixed with editor category
  • Unique across all panels

Implements yaze::editor::WindowContent.

Definition at line 38 of file pixel_editor_panel.h.

◆ GetDisplayName()

std::string yaze::editor::PixelEditorPanel::GetDisplayName ( ) const
inlineoverridevirtual

Human-readable name shown in menus and title bars.

Returns
Display name (e.g., "Room Selector")

Implements yaze::editor::WindowContent.

Definition at line 39 of file pixel_editor_panel.h.

◆ GetIcon()

std::string yaze::editor::PixelEditorPanel::GetIcon ( ) const
inlineoverridevirtual

Material Design icon for this panel.

Returns
Icon constant (e.g., ICON_MD_LIST)

Implements yaze::editor::WindowContent.

Definition at line 40 of file pixel_editor_panel.h.

References ICON_MD_BRUSH.

◆ GetEditorCategory()

std::string yaze::editor::PixelEditorPanel::GetEditorCategory ( ) const
inlineoverridevirtual

Editor category this panel belongs to.

Returns
Category name matching EditorType (e.g., "Dungeon", "Overworld")

Implements yaze::editor::WindowContent.

Definition at line 41 of file pixel_editor_panel.h.

◆ GetPriority()

int yaze::editor::PixelEditorPanel::GetPriority ( ) const
inlineoverridevirtual

Get display priority for menu ordering.

Returns
Priority value (lower = higher in list, default 50)

Reimplemented from yaze::editor::WindowContent.

Definition at line 42 of file pixel_editor_panel.h.

◆ Initialize()

void yaze::editor::PixelEditorPanel::Initialize ( )

Initialize the panel.

Definition at line 74 of file pixel_editor_panel.cc.

◆ SetRom()

void yaze::editor::PixelEditorPanel::SetRom ( Rom * rom)
inline

Definition at line 53 of file pixel_editor_panel.h.

References rom_.

◆ SetSourcePreviewCallback()

void yaze::editor::PixelEditorPanel::SetSourcePreviewCallback ( std::function< void()> draw)
inline

Definition at line 55 of file pixel_editor_panel.h.

References draw_source_preview_.

◆ ShowSourcePreview()

void yaze::editor::PixelEditorPanel::ShowSourcePreview ( )
inline

Definition at line 58 of file pixel_editor_panel.h.

References show_source_preview_.

◆ SetSheetBrowserCallbacks()

void yaze::editor::PixelEditorPanel::SetSheetBrowserCallbacks ( std::function< bool()> visible,
std::function< void(bool)> set_visible )
inline

Definition at line 60 of file pixel_editor_panel.h.

References set_sheet_browser_visible_, and sheet_browser_visible_.

◆ Draw()

void yaze::editor::PixelEditorPanel::Draw ( bool * p_open)
overridevirtual

Draw the pixel editor UI (WindowContent interface)

Implements yaze::editor::WindowContent.

Definition at line 78 of file pixel_editor_panel.cc.

References Update().

Here is the call graph for this function:

◆ Update()

◆ CopyToSystemClipboard()

◆ CutToSystemClipboard()

◆ PasteFromSystemClipboard()

◆ HasActiveStroke()

bool yaze::editor::PixelEditorPanel::HasActiveStroke ( ) const
inline

Definition at line 83 of file pixel_editor_panel.h.

References stroke_.

Referenced by DrawColorPicker(), and DrawToolbar().

◆ FinishGesture()

◆ FinishReleasedGesture()

void yaze::editor::PixelEditorPanel::FinishReleasedGesture ( )

Definition at line 1040 of file pixel_editor_panel.cc.

References cursor_x_, cursor_y_, FinishGesture(), is_drawing_, and last_mouse_pixel_.

Referenced by Update().

Here is the call graph for this function:

◆ SetHistoryCallbacks()

void yaze::editor::PixelEditorPanel::SetHistoryCallbacks ( std::function< absl::Status()> undo,
std::function< absl::Status()> redo )
inline

Definition at line 88 of file pixel_editor_panel.h.

References redo_, and undo_.

◆ SetPaletteReorderCallback()

void yaze::editor::PixelEditorPanel::SetPaletteReorderCallback ( PaletteReorderControl::Apply apply)
inline

Definition at line 93 of file pixel_editor_panel.h.

References apply_palette_reorder_.

◆ DrawSourceContext()

◆ DisplaySheet()

◆ DisplayPalette()

◆ DrawToolbar()

◆ DrawViewControls()

◆ DrawCanvas()

void yaze::editor::PixelEditorPanel::DrawCanvas ( )
private

Draw the main editing canvas.

Definition at line 444 of file pixel_editor_panel.cc.

References yaze::gui::BeginThemedTabBar(), canvas_, yaze::editor::GraphicsEditorState::CloseSheet(), yaze::editor::GraphicsEditorState::current_sheet_id, yaze::editor::GraphicsEditorState::current_tool, cursor_in_canvas_, DisplaySheet(), yaze::gui::Canvas::draw_list(), yaze::gui::Canvas::DrawBackground(), DrawBrushPreview(), DrawCursorCrosshair(), DrawFloatingPaste(), yaze::gui::Canvas::DrawGrid(), yaze::gui::Canvas::DrawOverlay(), DrawPixelGrids(), DrawPixelInfoTooltip(), DrawTileHighlight(), DrawTransparencyGrid(), yaze::gui::EndThemedTabBar(), FinishGesture(), fit_canvas_requested_, yaze::gfx::Arena::Get(), yaze::gfx::Arena::gfx_sheets(), HandleCanvasInput(), yaze::editor::PixelSelection::height, yaze::editor::PixelSelection::is_active, is_drawing_, yaze::editor::kBrush, yaze::editor::kEraser, yaze::editor::kLine, yaze::editor::kRectangle, yaze::editor::GraphicsEditorState::modified_sheets, yaze::editor::GraphicsEditorState::open_sheets, PixelToScreen(), preview_end_, yaze::editor::GraphicsEditorState::requested_sheet_tab, yaze::editor::GraphicsEditorState::selection, yaze::editor::GraphicsEditorState::SetZoom(), yaze::editor::GraphicsEditorState::show_brush_preview, yaze::editor::GraphicsEditorState::show_cursor_crosshair, yaze::editor::GraphicsEditorState::show_grid, yaze::editor::GraphicsEditorState::show_pixel_info_tooltip, show_tool_preview_, yaze::editor::GraphicsEditorState::show_transparency_grid, state_, tool_start_pixel_, yaze::editor::PixelSelection::width, yaze::editor::PixelSelection::x, yaze::editor::PixelSelection::y, yaze::gui::Canvas::zero_point(), and yaze::editor::GraphicsEditorState::zoom_level.

Referenced by Update().

◆ DrawColorPicker()

◆ DrawStatusBar()

◆ DrawMiniMap()

void yaze::editor::PixelEditorPanel::DrawMiniMap ( )
private

Draw the mini navigation map.

Todo
Calculate actual viewport bounds based on scroll position

Definition at line 853 of file pixel_editor_panel.cc.

References DisplaySheet(), yaze::editor::GraphicsEditorState::open_sheets, and state_.

Referenced by DrawViewControls().

Here is the call graph for this function:

◆ HandleCanvasInput()

◆ ApplyPencil()

void yaze::editor::PixelEditorPanel::ApplyPencil ( int x,
int y )
private

Apply pencil tool at position.

Definition at line 1078 of file pixel_editor_panel.cc.

References yaze::editor::GraphicsEditorState::current_color_index, ShowStrokeChanges(), state_, and StrokeEdit().

Referenced by HandleCanvasInput().

Here is the call graph for this function:

◆ ApplyBrush()

void yaze::editor::PixelEditorPanel::ApplyBrush ( int x,
int y )
private

Apply brush tool at position.

Definition at line 1086 of file pixel_editor_panel.cc.

References yaze::editor::GraphicsEditorState::brush_size, yaze::editor::GraphicsEditorState::current_color_index, ShowStrokeChanges(), state_, and StrokeEdit().

Referenced by HandleCanvasInput().

Here is the call graph for this function:

◆ ApplyEraser()

void yaze::editor::PixelEditorPanel::ApplyEraser ( int x,
int y )
private

Apply eraser tool at position.

Definition at line 1102 of file pixel_editor_panel.cc.

References yaze::editor::GraphicsEditorState::brush_size, ShowStrokeChanges(), state_, and StrokeEdit().

Referenced by HandleCanvasInput().

Here is the call graph for this function:

◆ ApplyFill()

void yaze::editor::PixelEditorPanel::ApplyFill ( int x,
int y )
private

Apply flood fill starting at position.

Definition at line 1118 of file pixel_editor_panel.cc.

References yaze::editor::GraphicsEditorState::current_color_index, ShowStrokeChanges(), state_, and StrokeEdit().

Referenced by HandleCanvasInput().

Here is the call graph for this function:

◆ ApplyEyedropper()

void yaze::editor::PixelEditorPanel::ApplyEyedropper ( int x,
int y )
private

Apply eyedropper tool at position.

Definition at line 1168 of file pixel_editor_panel.cc.

References yaze::editor::GraphicsEditorState::current_color_index, yaze::editor::GraphicsEditorState::current_sheet_id, yaze::gfx::Arena::Get(), yaze::gfx::Arena::gfx_sheets(), and state_.

Referenced by HandleCanvasInput().

Here is the call graph for this function:

◆ DrawLine()

void yaze::editor::PixelEditorPanel::DrawLine ( int x1,
int y1,
int x2,
int y2 )
private

Draw line from start to end.

Definition at line 1176 of file pixel_editor_panel.cc.

References yaze::editor::GraphicsEditorState::current_color_index, ShowStrokeChanges(), state_, and StrokeEdit().

Referenced by FinishGesture().

Here is the call graph for this function:

◆ DrawRectangle()

void yaze::editor::PixelEditorPanel::DrawRectangle ( int x1,
int y1,
int x2,
int y2,
bool filled )
private

Draw rectangle from start to end.

Definition at line 1210 of file pixel_editor_panel.cc.

References yaze::editor::GraphicsEditorState::current_color_index, ShowStrokeChanges(), state_, and StrokeEdit().

Referenced by FinishGesture().

Here is the call graph for this function:

◆ BeginSelection()

◆ UpdateSelection()

void yaze::editor::PixelEditorPanel::UpdateSelection ( int x,
int y )
private

◆ EndSelection()

◆ CopySelection()

void yaze::editor::PixelEditorPanel::CopySelection ( )
private

Copy selection to clipboard.

Definition at line 1290 of file pixel_editor_panel.cc.

◆ PasteSelection()

void yaze::editor::PixelEditorPanel::PasteSelection ( int x,
int y )
private

◆ FlipSelectionHorizontal()

void yaze::editor::PixelEditorPanel::FlipSelectionHorizontal ( )
private

◆ FlipSelectionVertical()

void yaze::editor::PixelEditorPanel::FlipSelectionVertical ( )
private

◆ BeginStroke()

void yaze::editor::PixelEditorPanel::BeginStroke ( )
private

Starts a stroke on the current sheet. Pixel writes go to the session's GraphicsSheetStore until EndStroke().

Definition at line 1347 of file pixel_editor_panel.cc.

References yaze::editor::ActiveSheetStore(), yaze::editor::GraphicsEditorState::current_sheet_id, EndStroke(), state_, and stroke_.

Referenced by CommitFloatingPaste(), CutToSystemClipboard(), HandleCanvasInput(), PasteSelection(), and StrokeEdit().

Here is the call graph for this function:

◆ EndStroke()

void yaze::editor::PixelEditorPanel::EndStroke ( )
private

◆ StrokeEdit()

zelda3::GraphicsSheetStore::Edit * yaze::editor::PixelEditorPanel::StrokeEdit ( )
private

The stroke's edit on the current sheet (starting one if needed), or null when the sheet cannot be edited: graphics are not loaded, or the Arena shows another open ROM's sheets.

Definition at line 1359 of file pixel_editor_panel.cc.

References BeginStroke(), yaze::editor::GraphicsEditorState::current_sheet_id, state_, and stroke_.

Referenced by ApplyBrush(), ApplyEraser(), ApplyFill(), ApplyPencil(), CommitFloatingPaste(), CutToSystemClipboard(), DrawLine(), DrawRectangle(), and PasteSelection().

Here is the call graph for this function:

◆ ShowStrokeChanges()

void yaze::editor::PixelEditorPanel::ShowStrokeChanges ( bool changed)
private

After pixel writes: refresh the Arena copy and mark the sheet modified.

Definition at line 1366 of file pixel_editor_panel.cc.

References yaze::editor::GraphicsEditorState::MarkSheetModified(), yaze::editor::RefreshArenaSheet(), state_, and stroke_.

Referenced by ApplyBrush(), ApplyEraser(), ApplyFill(), ApplyPencil(), CommitFloatingPaste(), CutToSystemClipboard(), DrawLine(), DrawRectangle(), and PasteSelection().

Here is the call graph for this function:

◆ ScreenToPixel()

ImVec2 yaze::editor::PixelEditorPanel::ScreenToPixel ( ImVec2 screen_pos)
private

Convert screen coordinates to pixel coordinates.

Definition at line 1741 of file pixel_editor_panel.cc.

References canvas_, state_, yaze::gui::Canvas::zero_point(), and yaze::editor::GraphicsEditorState::zoom_level.

Referenced by HandleCanvasInput().

Here is the call graph for this function:

◆ PixelToScreen()

ImVec2 yaze::editor::PixelEditorPanel::PixelToScreen ( int x,
int y )
private

Convert pixel coordinates to screen coordinates.

Definition at line 1747 of file pixel_editor_panel.cc.

References canvas_, state_, yaze::gui::Canvas::zero_point(), and yaze::editor::GraphicsEditorState::zoom_level.

Referenced by DrawBrushPreview(), DrawCanvas(), DrawCursorCrosshair(), DrawFloatingPaste(), and DrawTileHighlight().

Here is the call graph for this function:

◆ DrawTransparencyGrid()

void yaze::editor::PixelEditorPanel::DrawTransparencyGrid ( float canvas_width,
float canvas_height )
private

Draw checkerboard pattern for transparent pixels.

Definition at line 605 of file pixel_editor_panel.cc.

References canvas_, yaze::gui::Canvas::draw_list(), and yaze::gui::Canvas::zero_point().

Referenced by DrawCanvas().

Here is the call graph for this function:

◆ DrawCursorCrosshair()

void yaze::editor::PixelEditorPanel::DrawCursorCrosshair ( )
private

Draw crosshair at cursor position.

Definition at line 627 of file pixel_editor_panel.cc.

References canvas_, yaze::gui::Canvas::canvas_size(), cursor_x_, cursor_y_, yaze::gui::Canvas::draw_list(), PixelToScreen(), state_, yaze::gui::Canvas::zero_point(), and yaze::editor::GraphicsEditorState::zoom_level.

Referenced by DrawCanvas().

Here is the call graph for this function:

◆ DrawBrushPreview()

void yaze::editor::PixelEditorPanel::DrawBrushPreview ( )
private

◆ DrawPixelInfoTooltip()

void yaze::editor::PixelEditorPanel::DrawPixelInfoTooltip ( const gfx::Bitmap & sheet)
private

Draw tooltip with pixel information.

Definition at line 679 of file pixel_editor_panel.cc.

References cursor_x_, cursor_y_, DisplayPalette(), yaze::gfx::Bitmap::GetPixel(), yaze::gfx::Bitmap::height(), and yaze::gfx::Bitmap::width().

Referenced by DrawCanvas().

Here is the call graph for this function:

◆ DrawTileHighlight()

◆ HandleFloatingPasteKeys()

void yaze::editor::PixelEditorPanel::HandleFloatingPasteKeys ( )
private

◆ DrawClipboardControls()

◆ DrawFloatingPaste()

void yaze::editor::PixelEditorPanel::DrawFloatingPaste ( )
private

◆ HandleFloatingPasteInput()

bool yaze::editor::PixelEditorPanel::HandleFloatingPasteInput ( )
private

◆ CommitFloatingPaste()

void yaze::editor::PixelEditorPanel::CommitFloatingPaste ( )
private

◆ CancelFloatingPaste()

void yaze::editor::PixelEditorPanel::CancelFloatingPaste ( )
private

◆ ClampFloatingPaste()

void yaze::editor::PixelEditorPanel::ClampFloatingPaste ( )
private

◆ CurrentSheetColors()

SheetColors yaze::editor::PixelEditorPanel::CurrentSheetColors ( ) const
private

Definition at line 1442 of file pixel_editor_panel.cc.

References DisplayPalette().

Referenced by CopyToSystemClipboard(), DrawFloatingPaste(), and PasteFromSystemClipboard().

Here is the call graph for this function:

◆ HandlePanInput()

bool yaze::editor::PixelEditorPanel::HandlePanInput ( )
private

◆ DrawPaletteRowPicker()

void yaze::editor::PixelEditorPanel::DrawPaletteRowPicker ( )
private

◆ DrawPixelGrids()

void yaze::editor::PixelEditorPanel::DrawPixelGrids ( float canvas_width,
float canvas_height )
private

Friends And Related Symbol Documentation

◆ PixelEditorPanelTestPeer

friend class PixelEditorPanelTestPeer
friend

Definition at line 278 of file pixel_editor_panel.h.

◆ AuthoringSaveWorkflowTestPeer

friend class AuthoringSaveWorkflowTestPeer
friend

Definition at line 279 of file pixel_editor_panel.h.

Member Data Documentation

◆ undo_

std::function<absl::Status()> yaze::editor::PixelEditorPanel::undo_
private

Definition at line 98 of file pixel_editor_panel.h.

Referenced by DrawToolbar(), and SetHistoryCallbacks().

◆ redo_

std::function<absl::Status()> yaze::editor::PixelEditorPanel::redo_
private

Definition at line 99 of file pixel_editor_panel.h.

Referenced by DrawToolbar(), and SetHistoryCallbacks().

◆ history_error_

std::string yaze::editor::PixelEditorPanel::history_error_
private

Definition at line 100 of file pixel_editor_panel.h.

Referenced by DrawStatusBar(), and DrawToolbar().

◆ gesture_tool_

PixelTool yaze::editor::PixelEditorPanel::gesture_tool_ = PixelTool::kPencil
private

Definition at line 101 of file pixel_editor_panel.h.

Referenced by FinishGesture(), and HandleCanvasInput().

◆ palette_reorder_

PaletteReorderControl yaze::editor::PixelEditorPanel::palette_reorder_
private

Definition at line 102 of file pixel_editor_panel.h.

Referenced by DrawColorPicker().

◆ apply_palette_reorder_

PaletteReorderControl::Apply yaze::editor::PixelEditorPanel::apply_palette_reorder_
private

Definition at line 103 of file pixel_editor_panel.h.

Referenced by DrawColorPicker(), and SetPaletteReorderCallback().

◆ context_sheet_

gfx::Bitmap yaze::editor::PixelEditorPanel::context_sheet_
private

Definition at line 108 of file pixel_editor_panel.h.

Referenced by DisplaySheet().

◆ fit_canvas_requested_

bool yaze::editor::PixelEditorPanel::fit_canvas_requested_ = false
private

Definition at line 109 of file pixel_editor_panel.h.

Referenced by DrawCanvas(), DrawStatusBar(), and Update().

◆ show_source_preview_

bool yaze::editor::PixelEditorPanel::show_source_preview_ = true
private

Definition at line 110 of file pixel_editor_panel.h.

Referenced by DrawSourceContext(), ShowSourcePreview(), and Update().

◆ draw_source_preview_

std::function<void()> yaze::editor::PixelEditorPanel::draw_source_preview_
private

Definition at line 111 of file pixel_editor_panel.h.

Referenced by DrawSourceContext(), SetSourcePreviewCallback(), and Update().

◆ sheet_browser_visible_

std::function<bool()> yaze::editor::PixelEditorPanel::sheet_browser_visible_
private

Definition at line 112 of file pixel_editor_panel.h.

Referenced by SetSheetBrowserCallbacks(), and Update().

◆ set_sheet_browser_visible_

std::function<void(bool)> yaze::editor::PixelEditorPanel::set_sheet_browser_visible_
private

Definition at line 113 of file pixel_editor_panel.h.

Referenced by SetSheetBrowserCallbacks(), and Update().

◆ state_

◆ rom_

Rom* yaze::editor::PixelEditorPanel::rom_
private

Definition at line 282 of file pixel_editor_panel.h.

Referenced by SetRom().

◆ undo_manager_

UndoManager* yaze::editor::PixelEditorPanel::undo_manager_ = nullptr
private

Definition at line 283 of file pixel_editor_panel.h.

Referenced by DrawToolbar(), and EndStroke().

◆ canvas_

gui::Canvas yaze::editor::PixelEditorPanel::canvas_
private

◆ stroke_

std::optional<zelda3::GraphicsSheetStore::Edit> yaze::editor::PixelEditorPanel::stroke_
private

◆ is_drawing_

bool yaze::editor::PixelEditorPanel::is_drawing_ = false
private

◆ last_mouse_pixel_

ImVec2 yaze::editor::PixelEditorPanel::last_mouse_pixel_ = {-1, -1}
private

Definition at line 292 of file pixel_editor_panel.h.

Referenced by FinishReleasedGesture(), and HandleCanvasInput().

◆ tool_start_pixel_

ImVec2 yaze::editor::PixelEditorPanel::tool_start_pixel_ = {-1, -1}
private

◆ show_tool_preview_

bool yaze::editor::PixelEditorPanel::show_tool_preview_ = false
private

Definition at line 296 of file pixel_editor_panel.h.

Referenced by DrawCanvas(), FinishGesture(), and HandleCanvasInput().

◆ preview_end_

ImVec2 yaze::editor::PixelEditorPanel::preview_end_ = {0, 0}
private

Definition at line 297 of file pixel_editor_panel.h.

Referenced by DrawCanvas(), and HandleCanvasInput().

◆ cursor_x_

int yaze::editor::PixelEditorPanel::cursor_x_ = 0
private

◆ cursor_y_

int yaze::editor::PixelEditorPanel::cursor_y_ = 0
private

◆ cursor_in_canvas_

bool yaze::editor::PixelEditorPanel::cursor_in_canvas_ = false
private

Definition at line 302 of file pixel_editor_panel.h.

Referenced by DrawCanvas(), DrawStatusBar(), and HandleCanvasInput().

◆ clipboard_status_

std::string yaze::editor::PixelEditorPanel::clipboard_status_
private

◆ clipboard_status_is_error_

bool yaze::editor::PixelEditorPanel::clipboard_status_is_error_ = false
private

◆ paste_skip_color0_

bool yaze::editor::PixelEditorPanel::paste_skip_color0_ = false
private

◆ dragging_paste_

bool yaze::editor::PixelEditorPanel::dragging_paste_ = false
private

◆ paste_drag_dx_

int yaze::editor::PixelEditorPanel::paste_drag_dx_ = 0
private

Definition at line 320 of file pixel_editor_panel.h.

Referenced by HandleFloatingPasteInput().

◆ paste_drag_dy_

int yaze::editor::PixelEditorPanel::paste_drag_dy_ = 0
private

Definition at line 321 of file pixel_editor_panel.h.

Referenced by HandleFloatingPasteInput().


The documentation for this class was generated from the following files: