Skip to content

Commit

Permalink
Fix rendering of horizontal/vertical constraint labels.
Browse files Browse the repository at this point in the history
This was a regression from 2.2 to 3.0, caused by the Canvas
transition.
  • Loading branch information
Evil-Spirit authored and whitequark committed Nov 17, 2016
1 parent 1ec36fc commit 3b24139
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/drawconstraint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1119,7 +1119,10 @@ void Constraint::DoLayout(DrawAs how, Canvas *canvas,
}
Vector o = m.Plus(offset).Plus(u.WithMagnitude(textHeight/5)),
ex = VectorFont::Builtin()->GetExtents(textHeight, s);
canvas->DrawVectorText(s, textHeight, o.Minus(ex.ScaledBy(0.5)),
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);
} else {
Expand Down

0 comments on commit 3b24139

Please sign in to comment.