mirror of
https://github.com/aseprite/aseprite.git
synced 2025-04-07 10:21:30 +00:00
Fix panning canvas out of view clips in Auto Guides (fix #2994)
This commit is contained in:
parent
04fa9a47ab
commit
31bf651d8b
@ -961,10 +961,9 @@ void Editor::drawSpriteUnclippedRect(ui::Graphics* g, const gfx::Rect& _rc)
|
|||||||
|
|
||||||
// Draw active layer/cel edges
|
// Draw active layer/cel edges
|
||||||
if ((m_docPref.show.layerEdges() || m_showAutoCelGuides) &&
|
if ((m_docPref.show.layerEdges() || m_showAutoCelGuides) &&
|
||||||
// Show layer edges only on "standby" like states where brush
|
// Show layer edges and possibly cel guides only on states that
|
||||||
// preview is shown (e.g. with this we avoid to showing the
|
// allows it (e.g scrolling state)
|
||||||
// edges in states like DrawingState, etc.).
|
m_state->allowLayerEdges()) {
|
||||||
m_state->requireBrushPreview()) {
|
|
||||||
Cel* cel = (m_layer ? m_layer->cel(m_frame): nullptr);
|
Cel* cel = (m_layer ? m_layer->cel(m_frame): nullptr);
|
||||||
if (cel) {
|
if (cel) {
|
||||||
gfx::Color color = color_utils::color_for_ui(Preferences::instance().guides.layerEdgesColor());
|
gfx::Color color = color_utils::color_for_ui(Preferences::instance().guides.layerEdgesColor());
|
||||||
@ -2952,7 +2951,7 @@ void Editor::updateAutoCelGuides(ui::Message* msg)
|
|||||||
// Check if the user is pressing the Ctrl or Cmd key on move
|
// Check if the user is pressing the Ctrl or Cmd key on move
|
||||||
// tool to show automatic guides.
|
// tool to show automatic guides.
|
||||||
if (m_showAutoCelGuides &&
|
if (m_showAutoCelGuides &&
|
||||||
m_state->requireBrushPreview()) {
|
m_state->allowLayerEdges()) {
|
||||||
auto mouseMsg = dynamic_cast<ui::MouseMessage*>(msg);
|
auto mouseMsg = dynamic_cast<ui::MouseMessage*>(msg);
|
||||||
|
|
||||||
ColorPicker picker;
|
ColorPicker picker;
|
||||||
|
@ -124,6 +124,9 @@ namespace app {
|
|||||||
// drawing cursor.
|
// drawing cursor.
|
||||||
virtual bool requireBrushPreview() { return false; }
|
virtual bool requireBrushPreview() { return false; }
|
||||||
|
|
||||||
|
// Returns true if this state allow layer edges and cel guides
|
||||||
|
virtual bool allowLayerEdges() { return false; }
|
||||||
|
|
||||||
// Returns true if this state accept the given quicktool.
|
// Returns true if this state accept the given quicktool.
|
||||||
virtual bool acceptQuickTool(tools::Tool* tool) { return true; }
|
virtual bool acceptQuickTool(tools::Tool* tool) { return true; }
|
||||||
|
|
||||||
|
@ -24,6 +24,7 @@ namespace app {
|
|||||||
virtual bool onKeyDown(Editor* editor, ui::KeyMessage* msg) override;
|
virtual bool onKeyDown(Editor* editor, ui::KeyMessage* msg) override;
|
||||||
virtual bool onKeyUp(Editor* editor, ui::KeyMessage* msg) override;
|
virtual bool onKeyUp(Editor* editor, ui::KeyMessage* msg) override;
|
||||||
virtual bool onUpdateStatusBar(Editor* editor) override;
|
virtual bool onUpdateStatusBar(Editor* editor) override;
|
||||||
|
virtual bool allowLayerEdges() override { return true; }
|
||||||
|
|
||||||
virtual LeaveAction onLeaveState(Editor* editor, EditorState* newState) override {
|
virtual LeaveAction onLeaveState(Editor* editor, EditorState* newState) override {
|
||||||
// Just discard this state if we want to enter to another state
|
// Just discard this state if we want to enter to another state
|
||||||
|
@ -46,6 +46,9 @@ namespace app {
|
|||||||
// the brush-preview.
|
// the brush-preview.
|
||||||
virtual bool requireBrushPreview() override { return true; }
|
virtual bool requireBrushPreview() override { return true; }
|
||||||
|
|
||||||
|
// Layer edges and cel guides are allowed to be drawn.
|
||||||
|
virtual bool allowLayerEdges() override { return true; }
|
||||||
|
|
||||||
virtual Transformation getTransformation(Editor* editor);
|
virtual Transformation getTransformation(Editor* editor);
|
||||||
|
|
||||||
void startSelectionTransformation(Editor* editor, const gfx::Point& move, double angle);
|
void startSelectionTransformation(Editor* editor, const gfx::Point& move, double angle);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user