Reputation: 1892
I need to render a TextArea
in an exact pixel width for the special purposes of my GUI.
When I set its width to "250px", it comes out as 256px.
Is there a way to override this behavior so I can render it as 250px exactly?
Upvotes: 0
Views: 1731
Reputation: 16263
When you use setWidth()
, you're effectively setting the element's content width.
To get the offset width use UIObject#getOffsetWidth()
. This will return the width including padding and border (but not margins).
Upvotes: 4