Add RecommendedHeight to TypeSetter
This commit is contained in:
parent
197346d730
commit
4be5154df0
@ -175,6 +175,14 @@ func (this *TypeSetter) PositionAt (index int) fixed.Point26_6 {
|
||||
return position
|
||||
}
|
||||
|
||||
// ReccomendedHeightFor returns the reccomended max height if the text were to
|
||||
// have its maximum width set to the given width. This does not actually move
|
||||
// any text, it only simulates it.
|
||||
func (this *TypeSetter) RecommendedHeight (width fixed.Int26_6) fixed.Int26_6 {
|
||||
this.needMeasurement()
|
||||
return recommendHeight(this.tokens, this.face, width)
|
||||
}
|
||||
|
||||
// SetAlign sets the horizontal and vertical alignment of the text.
|
||||
func (this *TypeSetter) SetAlign (x, y Align) {
|
||||
if this.xAlign == x && this.yAlign == y { return }
|
||||
|
Loading…
Reference in New Issue
Block a user