From 1229d3700bd162aef53e388c7b38945178643aaa Mon Sep 17 00:00:00 2001 From: David Capello Date: Thu, 9 Nov 2017 16:06:22 -0300 Subject: [PATCH] Draw layer bounds and cels auto guides in the main tile position --- src/app/ui/editor/editor.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/app/ui/editor/editor.cpp b/src/app/ui/editor/editor.cpp index f4efdc70e..dbf445ea1 100644 --- a/src/app/ui/editor/editor.cpp +++ b/src/app/ui/editor/editor.cpp @@ -1051,7 +1051,10 @@ void Editor::drawCelGuides(ui::Graphics* g, const Cel* cel, const Cel* mouseCel) // Use whole canvas else { sprCmpBounds = m_sprite->bounds(); - scrCmpBounds = editorToScreen(sprCmpBounds).offset(gfx::Point(-bounds().origin())); + scrCmpBounds = + editorToScreen( + gfx::Rect(sprCmpBounds).offset(mainTilePosition())) + .offset(gfx::Point(-bounds().origin())); } const int midX = scrCelBounds.x+scrCelBounds.w/2; @@ -1169,12 +1172,20 @@ void Editor::drawCelVGuide(ui::Graphics* g, gfx::Rect Editor::getCelScreenBounds(const Cel* cel) { + gfx::Point mainOffset(mainTilePosition()); gfx::Rect layerEdges; if (m_layer->isReference()) { - layerEdges = editorToScreenF(cel->boundsF()).offset(gfx::PointF(-bounds().origin())); + layerEdges = + editorToScreenF( + gfx::RectF(cel->boundsF()).offset(mainOffset.x, + mainOffset.y)) + .offset(gfx::PointF(-bounds().origin())); } else { - layerEdges = editorToScreen(cel->bounds()).offset(-bounds().origin()); + layerEdges = + editorToScreen( + gfx::Rect(cel->bounds()).offset(mainOffset)) + .offset(-bounds().origin()); } return layerEdges; }