diff --git a/src/app/commands/cmd_canvas_size.cpp b/src/app/commands/cmd_canvas_size.cpp index 82136592a..992471b44 100644 --- a/src/app/commands/cmd_canvas_size.cpp +++ b/src/app/commands/cmd_canvas_size.cpp @@ -53,8 +53,8 @@ public: : m_editor(current_editor) , m_rect(0, 0, current_editor->sprite()->width(), current_editor->sprite()->height()) , m_selectBoxState(new SelectBoxState(this, m_rect, - SelectBoxState::PaintRulers | - SelectBoxState::PaintDarkOutside)) { + SelectBoxState::RULERS | + SelectBoxState::DARKOUTSIDE)) { setWidth(m_rect.w); setHeight(m_rect.h); setLeft(0); diff --git a/src/app/commands/cmd_import_sprite_sheet.cpp b/src/app/commands/cmd_import_sprite_sheet.cpp index c81bd8398..9be73488c 100644 --- a/src/app/commands/cmd_import_sprite_sheet.cpp +++ b/src/app/commands/cmd_import_sprite_sheet.cpp @@ -192,8 +192,8 @@ private: m_editor = current_editor; EditorStatePtr newState(new SelectBoxState(this, m_rect, - SelectBoxState::PaintRulers | - SelectBoxState::PaintGrid)); + SelectBoxState::RULERS | + SelectBoxState::GRID)); m_editor->setState(newState); } } diff --git a/src/app/ui/editor/select_box_state.cpp b/src/app/ui/editor/select_box_state.cpp index da1c5fec4..156becedf 100644 --- a/src/app/ui/editor/select_box_state.cpp +++ b/src/app/ui/editor/select_box_state.cpp @@ -23,11 +23,11 @@ namespace app { using namespace ui; -SelectBoxState::SelectBoxState(SelectBoxDelegate* delegate, const gfx::Rect& rc, PaintFlags paintFlags) +SelectBoxState::SelectBoxState(SelectBoxDelegate* delegate, const gfx::Rect& rc, Flags flags) : m_delegate(delegate) , m_rulers(4) , m_movingRuler(-1) - , m_paintFlags(paintFlags) + , m_flags(flags) { setBoxBounds(rc); } @@ -142,7 +142,7 @@ bool SelectBoxState::onSetCursor(Editor* editor) void SelectBoxState::preRenderDecorator(EditorPreRender* render) { // Without black shadow? - if (!hasPaintFlag(PaintDarkOutside)) + if (!hasFlag(DARKOUTSIDE)) return; gfx::Rect rc = getBoxBounds(); @@ -177,7 +177,7 @@ void SelectBoxState::postRenderDecorator(EditorPostRender* render) vp = editor->screenToEditor(vp); // Paint a grid generated by the box - if (hasPaintFlag(PaintGrid)) { + if (hasFlag(GRID)) { gfx::Color gridColor = gfx::rgba(100, 200, 100); gfx::Rect boxBounds = getBoxBounds(); @@ -191,7 +191,7 @@ void SelectBoxState::postRenderDecorator(EditorPostRender* render) } // Draw the rulers enclosing the box - if (hasPaintFlag(PaintRulers)) { + if (hasFlag(RULERS)) { gfx::Color rulerColor = gfx::rgba(0, 0, 255); for (Rulers::iterator it = m_rulers.begin(), end = m_rulers.end(); it != end; ++it) { @@ -222,9 +222,9 @@ bool SelectBoxState::touchRuler(Editor* editor, Ruler& ruler, int x, int y) return false; } -bool SelectBoxState::hasPaintFlag(PaintFlags flag) const +bool SelectBoxState::hasFlag(Flags flag) const { - return ((m_paintFlags & flag) == flag); + return ((m_flags & flag) == flag); } } // namespace app diff --git a/src/app/ui/editor/select_box_state.h b/src/app/ui/editor/select_box_state.h index 00681a2e4..89a46ee5f 100644 --- a/src/app/ui/editor/select_box_state.h +++ b/src/app/ui/editor/select_box_state.h @@ -28,14 +28,14 @@ namespace app { enum { H1, H2, V1, V2 }; public: - typedef int PaintFlags; - static const int PaintRulers = 1; - static const int PaintDarkOutside = 2; - static const int PaintGrid = 4; + typedef int Flags; + static const int RULERS = 1; + static const int DARKOUTSIDE = 2; + static const int GRID = 4; SelectBoxState(SelectBoxDelegate* delegate, const gfx::Rect& rc, - PaintFlags paintFlags); + Flags flags); // Returns the bounding box arranged by the rulers. gfx::Rect getBoxBounds() const; @@ -64,12 +64,12 @@ namespace app { // the given ruler. bool touchRuler(Editor* editor, Ruler& ruler, int x, int y); - bool hasPaintFlag(PaintFlags flag) const; + bool hasFlag(Flags flag) const; SelectBoxDelegate* m_delegate; Rulers m_rulers; int m_movingRuler; - PaintFlags m_paintFlags; + Flags m_flags; }; } // namespace app