Skip to content

Commit

Permalink
Render points corresponding to a DOF in the front layer.
Browse files Browse the repository at this point in the history
Before this commit, if any rendering mode except "show all occluded"
is enabled, points can be highlighted for corresponding to a DOF
after "Analyze → Degrees of Freedom" but then promptly occluded,
which is confusing.
  • Loading branch information
Evil-Spirit authored and whitequark committed Jan 20, 2017
1 parent db75e06 commit 86f229c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ Bugs fixed:
same orientation constraints are more robust.
* Adding some constraints (vertical, midpoint, etc) twice will now error out
immediately, instead of later and in a confusing way.
* Points highlighted with "Analyze → Show Degrees of Freedom" are drawn
on top of all other geometry.

2.3
---
Expand Down
18 changes: 10 additions & 8 deletions src/drawentity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -495,14 +495,6 @@ void Entity::Draw(DrawAs how, Canvas *canvas) {
stroke.zIndex = zIndex;
Canvas::hStroke hcs = canvas->GetStroke(stroke);

Canvas::Stroke pointStroke = {};
pointStroke.layer = stroke.layer;
pointStroke.zIndex = stroke.zIndex;
pointStroke.color = stroke.color;
pointStroke.width = 7.0;
pointStroke.unit = Canvas::Unit::PX;
Canvas::hStroke hcsPoint = canvas->GetStroke(pointStroke);

switch(type) {
case Type::POINT_N_COPY:
case Type::POINT_N_TRANS:
Expand All @@ -528,9 +520,19 @@ void Entity::Draw(DrawAs how, Canvas *canvas) {

free = pu->free || pv->free;
}

Canvas::Stroke pointStroke = {};
pointStroke.layer = (free) ? Canvas::Layer::FRONT : stroke.layer;
pointStroke.zIndex = stroke.zIndex;
pointStroke.color = stroke.color;
pointStroke.width = 7.0;
pointStroke.unit = Canvas::Unit::PX;
Canvas::hStroke hcsPoint = canvas->GetStroke(pointStroke);

if(free) {
Canvas::Stroke analyzeStroke = Style::Stroke(Style::ANALYZE);
analyzeStroke.width = 14.0;
analyzeStroke.layer = Canvas::Layer::FRONT;
Canvas::hStroke hcsAnalyze = canvas->GetStroke(analyzeStroke);

canvas->DrawPoint(PointGetNum(), hcsAnalyze);
Expand Down

0 comments on commit 86f229c

Please sign in to comment.