mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-29 19:20:09 +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
|
||||
if ((m_docPref.show.layerEdges() || m_showAutoCelGuides) &&
|
||||
// Show layer edges only on "standby" like states where brush
|
||||
// preview is shown (e.g. with this we avoid to showing the
|
||||
// edges in states like DrawingState, etc.).
|
||||
m_state->requireBrushPreview()) {
|
||||
// Show layer edges and possibly cel guides only on states that
|
||||
// allows it (e.g scrolling state)
|
||||
m_state->allowLayerEdges()) {
|
||||
Cel* cel = (m_layer ? m_layer->cel(m_frame): nullptr);
|
||||
if (cel) {
|
||||
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
|
||||
// tool to show automatic guides.
|
||||
if (m_showAutoCelGuides &&
|
||||
m_state->requireBrushPreview()) {
|
||||
m_state->allowLayerEdges()) {
|
||||
auto mouseMsg = dynamic_cast<ui::MouseMessage*>(msg);
|
||||
|
||||
ColorPicker picker;
|
||||
|
@ -124,6 +124,9 @@ namespace app {
|
||||
// drawing cursor.
|
||||
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.
|
||||
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 onKeyUp(Editor* editor, ui::KeyMessage* msg) override;
|
||||
virtual bool onUpdateStatusBar(Editor* editor) override;
|
||||
virtual bool allowLayerEdges() override { return true; }
|
||||
|
||||
virtual LeaveAction onLeaveState(Editor* editor, EditorState* newState) override {
|
||||
// Just discard this state if we want to enter to another state
|
||||
|
@ -46,6 +46,9 @@ namespace app {
|
||||
// the brush-preview.
|
||||
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);
|
||||
|
||||
void startSelectionTransformation(Editor* editor, const gfx::Point& move, double angle);
|
||||
|
Loading…
x
Reference in New Issue
Block a user