From 14deec24f5515c9f383881b214da5a37a8ea9512 Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Fri, 15 Sep 2023 01:55:57 -0400 Subject: [PATCH] API changes to support future functionality --- setter.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/setter.go b/setter.go index 522704a..d588567 100644 --- a/setter.go +++ b/setter.go @@ -117,10 +117,10 @@ func (setter *TypeSetter) SetWrap (wrap bool) { } // SetAlign sets the alignment method of the typesetter. -func (setter *TypeSetter) SetAlign (align Align) { - if setter.align == align { return } +func (setter *TypeSetter) SetAlign (horizontal, vertical Align) { + if setter.align == horizontal { return } setter.alignClean = false - setter.align = align + setter.align = horizontal } // SetText sets the text content of the typesetter. @@ -138,11 +138,9 @@ func (setter *TypeSetter) SetFace (face font.Face) { setter.face = face } -// TODO rename to SetWidth and SetHeight - // SetWidth sets the width of the typesetter. Text will still be able // to overflow outside of this width if wrapping is disabled. -func (setter *TypeSetter) SetMaxWidth (width int) { +func (setter *TypeSetter) SetWidth (width int) { if setter.maxWidth == width { return } setter.layoutClean = false setter.alignClean = false @@ -152,7 +150,7 @@ func (setter *TypeSetter) SetMaxWidth (width int) { // SetHeight sets the height of the typesetter. If the height is greater than // zero, no lines will be laid out past it. If the height is zero, the text's // maximum height will not be constrained. -func (setter *TypeSetter) SetMaxHeight (heignt int) { +func (setter *TypeSetter) SetHeight (heignt int) { if setter.maxHeight == heignt { return } setter.layoutClean = false setter.alignClean = false