Skip to content

Commit

Permalink
Fixed #74: Horizontal/vertical constraint labels are off
Browse files Browse the repository at this point in the history
  • Loading branch information
Evil-Spirit committed Nov 14, 2016
1 parent 804ad76 commit a3f9a4e
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 a3f9a4e

Please sign in to comment.