fyne.Size
import "fyne.io/fyne/v2"Usage
type Size
type Size struct {
Width float32 // The number of units along the X axis.
Height float32 // The number of units along the Y axis.
}Size describes something with width and height.
func MeasureText
func MeasureText(text string, size float32, style TextStyle) SizeMeasureText uses the current driver to calculate the size of text when rendered. The font used will be read from the current app’s theme.
func NewSize
func NewSize(w float32, h float32) SizeNewSize returns a newly allocated Size of the specified dimensions.
func NewSquareSize
func NewSquareSize(side float32) SizeNewSquareSize returns a newly allocated Size with the same width and height.
2.4func (Size) Add
func (s Size) Add(v Vector2) SizeAdd returns a new Size that is the result of increasing the current size by s2 Width and Height.
func (Size) AddWidthHeight
func (s Size) AddWidthHeight(width, height float32) SizeAddWidthHeight returns a new Size by adding width and height to the current one.
func (Size) Components
func (s Size) Components() (float32, float32)Components returns the Width and Height elements of this Size
func (Size) IsZero
func (s Size) IsZero() boolIsZero returns whether the Size has zero width and zero height.
func (Size) Max
func (s Size) Max(v Vector2) SizeMax returns a new [Size] that is the maximum of the current Size and s2.
func (Size) Min
func (s Size) Min(v Vector2) SizeMin returns a new [Size] that is the minimum of s and v.
func (Size) Subtract
func (s Size) Subtract(v Vector2) SizeSubtract returns a new Size that is the result of decreasing the current size by s2 Width and Height.
func (Size) SubtractWidthHeight
func (s Size) SubtractWidthHeight(width, height float32) SizeSubtractWidthHeight returns a new Size by subtracting width and height from the current one.