Fix rendering of horizontal/vertical constraint labels.

This was a regression from 2.2 to 3.0, caused by the Canvas
transition.
pull/109/head
Evil-Spirit 2016-11-14 21:25:22 +07:00 committed by whitequark
parent 1ec36fc657
commit 3b241392d4
1 changed files with 4 additions and 1 deletions

View File

@ -1119,7 +1119,10 @@ s:
}
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 {