text rotation is sucky.

This commit is contained in:
Will Charczuk 2016-08-31 22:11:52 -07:00
parent 102f7a8aa3
commit b78f2327aa
8 changed files with 140 additions and 12 deletions

View file

@ -177,12 +177,17 @@ func (rr *rasterRenderer) MeasureText(body string) Box {
t = 0
}
return Box{
textBox := Box{
Top: int(math.Ceil(t)),
Left: int(math.Ceil(l)),
Right: int(math.Ceil(r)),
Bottom: int(math.Ceil(b)),
}
if rr.rotateRadians == 0 {
return textBox
}
return textBox.Rotate(rr.rotateRadians)
}
// SetTextRotation sets a text rotation.