From 8749a175a60e0c3d0682705f15760e19b2058d65 Mon Sep 17 00:00:00 2001 From: whitequark Date: Tue, 17 Jan 2017 11:53:51 +0000 Subject: [PATCH] Draw constraints/entities when hovered or selected even if invisible. This goes really well with the related constraint/request lists, and in general seems very natural. --- src/drawconstraint.cpp | 5 +++-- src/drawentity.cpp | 3 ++- src/textscreens.cpp | 5 ----- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/drawconstraint.cpp b/src/drawconstraint.cpp index 68beda1..5b9de43 100644 --- a/src/drawconstraint.cpp +++ b/src/drawconstraint.cpp @@ -498,7 +498,8 @@ bool Constraint::DoLineExtend(Canvas *canvas, Canvas::hStroke hcs, void Constraint::DoLayout(DrawAs how, Canvas *canvas, Vector *labelPos, std::vector *refs) { - if(!IsVisible()) return; + if(!(how == DrawAs::HOVERED || how == DrawAs::SELECTED) && + !IsVisible()) return; // Unit vectors that describe our current view of the scene. One pixel // long, not one actual unit. @@ -1136,7 +1137,7 @@ s: ex = VectorFont::Builtin()->GetExtents(textHeight, s); Vector shift = r.WithMagnitude(ex.x).Plus( u.WithMagnitude(ex.y)); - + canvas->DrawVectorText(s, textHeight, o.Minus(shift.ScaledBy(0.5)), r.WithMagnitude(1), u.WithMagnitude(1), hcs); if(refs) refs->push_back(o); diff --git a/src/drawentity.cpp b/src/drawentity.cpp index cc93c82..5478b4a 100644 --- a/src/drawentity.cpp +++ b/src/drawentity.cpp @@ -443,7 +443,8 @@ void Entity::GenerateBezierCurves(SBezierList *sbl) const { } void Entity::Draw(DrawAs how, Canvas *canvas) { - if(!IsVisible()) return; + if(!(how == DrawAs::HOVERED || how == DrawAs::SELECTED) && + !IsVisible()) return; int zIndex; if(IsPoint()) { diff --git a/src/textscreens.cpp b/src/textscreens.cpp index 3ef6a73..8b3eb48 100644 --- a/src/textscreens.cpp +++ b/src/textscreens.cpp @@ -152,11 +152,6 @@ void TextWindow::ScreenHoverConstraint(int link, uint32_t v) { if(!SS.GW.showConstraints) return; hConstraint hc = { v }; - Constraint *c = SK.GetConstraint(hc); - if(c->group.v != SS.GW.activeGroup.v) { - // Only constraints in the active group are visible - return; - } SS.GW.hover.Clear(); SS.GW.hover.constraint = hc; SS.GW.hover.emphasized = true;