Documentation
¶
Index ¶
- Constants
- Variables
- func ColorF(c Color) func() Color
- func ForVectors(positions []Pos, close bool, handle func(s Pos, v Pos) bool)
- func GetHemisphereDirectionsFromGeoAlignment(alignment Alignment, separator, langCode string) string
- func GoGrayColor(gray float32) color.Gray
- func MaxCellsInLength(spacing, cellSize, inSize float64) int
- func MaxCellsInSize(spacing, cellSize, inSize Size) (x, y int)
- func PosLongLatToMeters(pos1 Pos, pos2 Pos) float64
- func TSL(s, lang string) string
- type Alignment
- func (a Alignment) And(b Alignment) Alignment
- func (a Alignment) FlippedHorizontal() Alignment
- func (a Alignment) FlippedVertical() Alignment
- func (a Alignment) Has(mask Alignment) bool
- func (a Alignment) HasAll(mask Alignment) bool
- func (a Alignment) MarshalJSON() ([]byte, error)
- func (a Alignment) Only(vertical bool) Alignment
- func (a Alignment) SplitIntoIndividual() (all []Alignment)
- func (a Alignment) String() string
- func (a Alignment) Subtracted(sub Alignment) Alignment
- func (a Alignment) Swapped() Alignment
- func (a Alignment) Union(b Alignment) Alignment
- func (a *Alignment) UnmarshalJSON(b []byte) error
- func (a Alignment) Vector() Pos
- type BoolSize
- type Circle
- type Color
- func ColorFromGo(c color.Color) Color
- func ColorFromSlice(s []float32) Color
- func ColorFromString(str string) Color
- func ColorNew(r, g, b, a float32) (c Color)
- func ColorNew255(r, g, b, a int) (c Color)
- func ColorNewGray(white, a float32) (c Color)
- func ColorNewHSBA(hsba HSBA) (c Color)
- func ColorRandom() Color
- func KelvinToColor(kelvin float32) Color
- func (c Color) AlteredContrast(contrast float32) Color
- func (c Color) ContrastingGray() Color
- func (c Color) Difference(a Color) float32
- func (c Color) GoColor() (gcol color.NRGBA64)
- func (c Color) GoGrayColor() color.Gray
- func (c Color) GrayScale() float32
- func (c Color) GrayScaleAndAlpha() (float32, float32)
- func (c Color) HSBA() (hsba HSBA)
- func (c Color) Hex() string
- func (c Color) HexNoAlpha() string
- func (c Color) MarshalJSON() ([]byte, error)
- func (c Color) Mixed(withColor Color, amount float32) Color
- func (c Color) MixedColor(withColor Color, amount float32) Color
- func (c Color) MultipliedBrightness(multiply float32) Color
- func (c Color) Opacity() float32
- func (c Color) OpacityInverted() Color
- func (c Color) RGBA() (r, g, b, a uint32)
- func (c Color) RGBAValue() RGBA
- func (c *Color) SetFromString(str string)
- func (c *Color) SetOpacity(opacity float32)
- func (c Color) Slice32() []float32
- func (c Color) SliceInt255() []int
- func (c *Color) UnmarshalJSON(b []byte) error
- func (c Color) WithOpacity(opacity float32) Color
- type FPos
- type FSize
- type Font
- type FontSetter
- type FontStyle
- type HSBA
- type IPos
- type ISize
- type LayoutCell
- type Matrix
- func (m Matrix) Inverted() (Matrix, bool)
- func (m Matrix) MulPos(pt Pos) Pos
- func (m Matrix) MulSize(sz Size) Size
- func (m Matrix) Multiplied(a Matrix) Matrix
- func (m Matrix) Rotated(angle float64) Matrix
- func (m Matrix) RotatedAroundPos(pos Pos, angle float64) Matrix
- func (m Matrix) Scaled(sz Size) Matrix
- func (m Matrix) TransformRect(rect Rect) Rect
- func (m Matrix) Translated(delta Size) Matrix
- func (m Matrix) TranslatedByPos(delta Pos) Matrix
- type Path
- func (p *Path) AddOval(inrect Rect)
- func (p *Path) AddPath(addPath *Path, join bool, m *Matrix)
- func (p *Path) AddRect(rect Rect, corner Size)
- func (p *Path) AddStar(rect Rect, points int, inRatio float32)
- func (p *Path) ArcDegFromCenter(center Pos, radius Size, degStart float64, degEnd float64)
- func (p *Path) ArcTo(rect Rect, degStart, degDelta float64, clockwise bool)
- func (p *Path) BezierTo(c1 Pos, c2 Pos, end Pos)
- func (p *Path) Circle(center Pos, radius Size)
- func (p *Path) Close()
- func (p *Path) Copy() *Path
- func (p *Path) Empty()
- func (p *Path) ForEachPart(forPart func(part PathNode))
- func (p *Path) GetPos() (Pos, bool)
- func (p *Path) IsEmpty() bool
- func (p *Path) LineTo(pos Pos)
- func (p *Path) MoveOrLineTo(pos Pos) bool
- func (p *Path) MoveTo(pos Pos)
- func (p *Path) NodeCount() int
- func (p *Path) QuadCurveTo(a, b Pos)
- func (p *Path) Rect() Rect
- func (p *Path) Rotated(deg float64, origin *Pos) *Path
- func (p *Path) Scan(value interface{}) error
- func (p *Path) Transformed(m *Matrix) (newPath *Path)
- func (p Path) Value() (driver.Value, error)
- type PathLineType
- type PathNode
- type PathPartType
- type Pos
- func GetTPositionInPosPath(path []Pos, t float64, close bool) Pos
- func PosBoth(n float64) Pos
- func PosD(x, y float64) Pos
- func PosF(x, y float32) Pos
- func PosFromAngleDeg(deg float64) Pos
- func PosFromGoPoint(point image.Point) Pos
- func PosFromString(str string) (Pos, error)
- func PosI(x, y int) Pos
- func TranslatePosInSystems(from, to Rect, pos Pos) Pos
- func (p Pos) Abs() Pos
- func (p *Pos) Add(a Pos)
- func (p Pos) AddedSize(s Size) Pos
- func (pos Pos) ArcTanToRad() float64
- func (p Pos) Average() float64
- func (p Pos) Ceil() Pos
- func (p Pos) Copy() Pos
- func (p Pos) DividedBy(a Pos) Pos
- func (p Pos) DividedByD(a float64) Pos
- func (p Pos) Dot(a Pos) float64
- func (p Pos) Element(vertical bool) float64
- func (p Pos) Equals(a Pos) bool
- func (p Pos) Floor() Pos
- func (p Pos) GetNormalized() Pos
- func (p Pos) GetRot90CW() Pos
- func (p Pos) GoPoint() image.Point
- func (p Pos) IsNull() bool
- func (p Pos) IsSameDirection(pos Pos) bool
- func (p Pos) Length() float64
- func (p Pos) Max(a Pos) Pos
- func (p Pos) Min(a Pos) Pos
- func (p Pos) Minus(a Pos) Pos
- func (p Pos) MinusD(a float64) Pos
- func (p *Pos) MultiplyD(a float64)
- func (p Pos) Negative() Pos
- func (p Pos) Plus(a Pos) Pos
- func (p Pos) PlusD(a float64) Pos
- func (p Pos) RotatedCCW(angle float64) Pos
- func (p Pos) Round() Pos
- func (p *Pos) Scan(value interface{}) error
- func (p *Pos) Set(x, y float64)
- func (p *Pos) SetF(x, y float32)
- func (p *Pos) SetOne(vertical bool, v float64)
- func (p Pos) Sign() Pos
- func (p Pos) Size() Size
- func (p Pos) String() string
- func (p *Pos) Subtract(a Pos)
- func (p *Pos) Swap()
- func (p Pos) Swapped() Pos
- func (p Pos) Times(a Pos) Pos
- func (p Pos) TimesD(a float64) Pos
- func (p Pos) ToAngleDeg() float64
- func (p Pos) Value() (driver.Value, error)
- func (p *Pos) ZUISetFromString(str string)
- func (p Pos) ZUIString() string
- type RGBA
- type Rect
- func CellsSpanInBox(box Rect, cellSize, spacing Size, cellCount int) (x, y int, area Rect)
- func LayoutCellsInStack(debugName string, rect Rect, vertical bool, spacing float64, ...) []Rect
- func MergeAllOverlapping(rects []Rect) []Rect
- func RectFromCenterSize(center Pos, size Size) Rect
- func RectFromGoRect(rect image.Rectangle) Rect
- func RectFromMarginSize(m Size) Rect
- func RectFromMinMax(min, max Pos) Rect
- func RectFromWH(w, h float64) Rect
- func RectFromXY2(x, y, x2, y2 float64) Rect
- func RectFromXYWH(x, y, w, h float64) Rect
- func RectMake(x0, y0, x1, y1 float64) Rect
- func RectMarginForSizeAndAlign(marg Size, align Alignment) Rect
- func TranslateRectInSystems(from, to Rect, r Rect) Rect
- func (r *Rect) Add(a Rect)
- func (r *Rect) AddPos(a Pos)
- func (r Rect) Align(s Size, align Alignment, marg Size) Rect
- func (r Rect) AlignPro(s Size, align Alignment, rmarg Rect, maxSize, minSize Size) Rect
- func (r Rect) BottomLeft() Pos
- func (r Rect) BottomRight() Pos
- func (r Rect) Center() Pos
- func (r Rect) Centered(center Pos) Rect
- func (r Rect) Contains(pos Pos) bool
- func (r Rect) DividedBy(a Size) Rect
- func (r Rect) DividedByD(d float64) Rect
- func (r Rect) Expanded(s Size) Rect
- func (r Rect) ExpandedD(n float64) Rect
- func (r Rect) ExpandedToInt() Rect
- func (r Rect) GoRect() image.Rectangle
- func (r *Rect) IncMax(x, y float64)
- func (r *Rect) IncMin(x, y float64)
- func (r Rect) Intersected(rect Rect) Rect
- func (r Rect) IsNull() bool
- func (r Rect) IsUndef() bool
- func (r Rect) MM() string
- func (r Rect) Max() Pos
- func (r Rect) Min() Pos
- func (r Rect) MinMax() (Pos, Pos)
- func (r Rect) Minus(a Rect) Rect
- func (r Rect) MovedInto(rect Rect) (m Rect)
- func (r Rect) NormalizedNegativeSize() Rect
- func (r Rect) Overlaps(rect Rect) bool
- func (r Rect) Plus(a Rect) Rect
- func (r Rect) PlusPos(pos Pos) Rect
- func (r *Rect) SetCenter(c Pos)
- func (r *Rect) SetMax(max Pos)
- func (r *Rect) SetMaxX(x float64)
- func (r *Rect) SetMaxY(y float64)
- func (r *Rect) SetMin(min Pos)
- func (r *Rect) SetMinX(x float64)
- func (r *Rect) SetMinY(y float64)
- func (r Rect) String() string
- func (r *Rect) Subtract(a Pos)
- func (r Rect) Swapped() Rect
- func (r Rect) TimesD(d float64) Rect
- func (r Rect) TopLeft() Pos
- func (r Rect) TopRight() Pos
- func (r *Rect) Translated(t Pos) Rect
- func (r *Rect) UnionWithPos(pos Pos)
- func (r Rect) UnionedWith(rect Rect) Rect
- func (r Rect) XCenter() float64
- func (r Rect) YCenter() float64
- type Size
- func LayoutGetCellsStackedSize(debugName string, vertical bool, spacing float64, cells []LayoutCell) (s, max Size)
- func SizeBoth(a float64) Size
- func SizeD(w, h float64) Size
- func SizeF(w, h float32) Size
- func SizeFromString(str string) (Size, error)
- func SizeI(w, h int) Size
- func SizeI64(w, h int64) Size
- func (s *Size) Add(a Size)
- func (s *Size) AddD(a float64)
- func (s Size) Area() float64
- func (s Size) Ceil() Size
- func (s Size) Contains(a Size) bool
- func (s Size) Copy() Size
- func (s *Size) DivideD(a float64)
- func (s Size) DividedBy(a Size) Size
- func (s Size) DividedByD(a float64) Size
- func (s Size) Element(vertical bool) float64
- func (s Size) EqualSided() Size
- func (s Size) Equals(a Size) bool
- func (s Size) ExpandedInto(in Size) Size
- func (s Size) Floor() Size
- func (s Size) ISize() ISize
- func (s Size) IsNull() bool
- func (s Size) IsUndef() bool
- func (s Size) MarshalJSON() ([]byte, error)
- func (s Size) Max() float64
- func (s Size) MaxWith(a Size) Size
- func (s *Size) Maximize(a Size)
- func (s Size) Min() float64
- func (s Size) MinWith(a Size) Size
- func (s *Size) Minimize(a Size)
- func (s *Size) MinimizeNonZero(a Size)
- func (s Size) Minus(a Size) Size
- func (s Size) MinusD(a float64) Size
- func (s *Size) MultiplyD(a float64)
- func (s *Size) MultiplyF(a float32)
- func (s Size) Negative() Size
- func (s Size) Plus(a Size) Size
- func (s Size) Pos() Pos
- func (s Size) Round() Size
- func (s Size) ScaledTo(in Size) Size
- func (s *Size) Scan(value interface{}) error
- func (s *Size) Set(w, h float64)
- func (s *Size) SetElement(vertical bool, n float64)
- func (s Size) ShrunkInto(in Size) Size
- func (s Size) String() string
- func (s *Size) Subtract(a Size)
- func (s *Size) SubtractD(d float64)
- func (s Size) Swapped() Size
- func (s Size) Times(a Size) Size
- func (s Size) TimesD(a float64) Size
- func (s *Size) UnmarshalJSON(b []byte) error
- func (s Size) Value() (driver.Value, error)
- func (s *Size) ZUISetFromString(str string)
- func (s Size) ZUIString() string
- type Sizes
Constants ¶
const ( Left Alignment = 1 << iota Right Top HorCenter VertCenter Bottom HorExpand VertExpand HorShrink VertShrink HorOut VertOut Proportional MarginIsOffset // MarginIsOffset is a special flag used to offset a center alignment in absolute, instead of relative to sides. AlignmentNone Alignment = 0 BottomLeft = Bottom | Left BottomRight = Bottom | Right BottomCenter = Bottom | HorCenter TopLeft = Top | Left TopRight = Top | Right TopCenter = Top | HorCenter CenterLeft = Left | VertCenter CenterRight = Right | VertCenter Center = HorCenter | VertCenter Expand = HorExpand | VertExpand Shrink = HorShrink | VertShrink HorScale = HorExpand | HorShrink VertScale = VertExpand | VertShrink Scale = HorScale | VertScale Out = HorOut | VertOut VertPos = Top | VertCenter | Bottom HorPos = Left | HorCenter | Right Vertical = VertPos | VertScale | VertOut Horizontal = HorPos | HorScale | HorOut )
Variables ¶
var ColorAqua = ColorNew(0, 1, 1, 1)
var ColorBlack = ColorNewGray(0, 1)
var ColorBlue = ColorNew(0, 0, 1, 1)
var ColorBrown = ColorNew(0.65, 0.26, 0.16, 1)
var ColorClear = ColorNewGray(0, 0)
var ColorCyan = ColorNew(0, 1, 1, 1)
var ColorDarkGray = ColorNewGray(0.25, 1)
var ColorDarkGreen = ColorNew(0, 0.5, 0, 1)
var ColorDistinctList = []Color{ColorOrange, ColorCyan, ColorMagenta, ColorGray, ColorBlack, ColorRed, ColorMaroon, ColorYellow, ColorOlive, ColorLime, ColorGreen, ColorDarkGreen, ColorAqua, ColorTeal, ColorBlue, ColorNavy, ColorDarkGray, ColorFuchsia, ColorPurple, ColorLightGray}
var ColorFuchsia = ColorNew(1, 0, 1, 1)
var ColorGray = ColorNewGray(0.5, 1)
var ColorGreen = ColorNew(0, 1, 0, 1)
var ColorLightGray = ColorNewGray(0.75, 1)
var ColorLime = ColorNew(0, 1, 0, 1)
var ColorMagenta = ColorNew(1, 0, 1, 1)
var ColorMaroon = ColorNew(0.5, 0, 0, 1)
var ColorOlive = ColorNew(0.5, 0.5, 0, 1)
var ColorOrange = ColorNew(1, 0.5, 0, 1)
var ColorPink = ColorNew(1, 0.8, 0.8, 1)
var ColorPurple = ColorNew(0.5, 0, 0.5, 1)
var ColorRed = ColorNew(1, 0, 0, 1)
var ColorSilver = ColorNew(0.75, 0.75, 0.75, 1)
var ColorTeal = ColorNew(0, 0.5, 0.5, 1)
var ColorWhite = ColorNewGray(1, 1)
var ColorYellow = ColorNew(1, 1, 0, 1)
var FontDefaultName = "Helvetica"
var FontDefaultSize = 14.0
DefaultSize This is used
var MatrixIdentity = Matrix{1, 0, 0, 1, 0, 0}
Functions ¶
func ForVectors ¶
iterates through positions, making vector between them, optionally closing
func GoGrayColor ¶
func MaxCellsInLength ¶
MaxCellsInLength returns how many cells with an cellSize and spacing with fit in inSize
func MaxCellsInSize ¶
func PosLongLatToMeters ¶
Types ¶
type Alignment ¶
func AlignmentFromString ¶
func (Alignment) FlippedHorizontal ¶
func (Alignment) FlippedVertical ¶
func (Alignment) MarshalJSON ¶
func (Alignment) SplitIntoIndividual ¶
For an Alignment that has multiple x/y alignments (i.e Left and Right), SplitIntoIndividual returns a slice of all combinations of them with only a single x/y combination each
func (Alignment) Subtracted ¶
func (Alignment) Swapped ¶
Swapped returns a new alignment where all the vertical alignments are the equivalent of what the horizontal ones were, and visa versa.
func (*Alignment) UnmarshalJSON ¶
type Color ¶
func ColorFromGo ¶
func ColorFromSlice ¶
ColorFromSlice returns a opaque gray for 1 item, graya for 2, opaque rgb for 3, and rgba for 4
func ColorFromString ¶
func ColorNew255 ¶
func ColorNewGray ¶
func ColorNewHSBA ¶
func ColorRandom ¶
func ColorRandom() Color
func KelvinToColor ¶
func (Color) AlteredContrast ¶
func (Color) ContrastingGray ¶
func (Color) Difference ¶
Difference returns the difference brween c and a, where 0 is same, 1 is black to white. Opacity is used, so each 4 components contribute 25% each
func (Color) GoGrayColor ¶
func (Color) GrayScaleAndAlpha ¶
func (Color) HexNoAlpha ¶
func (Color) MarshalJSON ¶
func (Color) Mixed ¶
Mixed() returns amount portion of withColor and 1-amount of c mixed. amount is first multiplied by withColor's alpha. The resulting alpha is the product of the two color alphas. If either color is not valid, the other one is returned.
func (Color) MixedColor ¶
MixedColor creates a color using HSBA with HS from withColor and BA from c. It is then mixed into c, effectively changing its color.
func (Color) MultipliedBrightness ¶
func (Color) OpacityInverted ¶
func (Color) RGBA ¶
RGBA returns r, g, b, a as 0-255 uint32 values. Makes it conform to image/color Color interface
func (*Color) SetFromString ¶
func (*Color) SetOpacity ¶
func (Color) SliceInt255 ¶
func (*Color) UnmarshalJSON ¶
func (Color) WithOpacity ¶
type Font ¶
type Font struct { Name string `json:"name"` Style FontStyle `json:"style"` Size float64 `json:"size"` }
TODO: Make font NOT pointer when passing around. Too easy to change something used elsewhere then
func FontDefault ¶
func (*Font) LineHeight ¶
func (*Font) NewWithSize ¶
func (*Font) NewWithStyle ¶
type FontSetter ¶
type FontSetter interface {
SetFont(*Font)
}
type FontStyle ¶
type FontStyle int
const ( FontStyleUndef FontStyle = 0 FontStyleNormal FontStyle = 1 FontStyleBold FontStyle = 2 FontStyleItalic FontStyle = 4 FontStyleBoldItalic FontStyle = FontStyleBold | FontStyleItalic )
func FontStyleFromStr ¶
type LayoutCell ¶
type LayoutCell struct { Alignment Alignment // Alignment is how cell is placed within parent rect and siblings. If AlignmentNone, it is not placed at all Margin Rect // Margin is the size around object in cell MaxSize Size // MaxSize is maximum size of object before margin. Can be only W or H MinSize Size // MinSize is minimum size of object before margin. Can be only W or H Collapsed bool // Collapsed is a cell that currently is not shown or takes up space. Free bool // Free Cells are placed using simple aligning to parent rect, not stacked etc OriginalSize Size // Original size of object before layout Divider float64 // This cell is a divider, wants its value subtracted from item before it, added to item after RelativeToName string // If Free, and set, it is aligned to other cell with name ShowIfExtraSpace float64 // If set, show only if enough extra space left over Name string // A name for debugging/aligning }
type Matrix ¶
type Matrix struct {
A, B, C, D, Tx, Ty float64
}
func MatrixForRotationDeg ¶
func RotateMatrix ¶
func ScaleMatrix ¶
func TranslateMatrix ¶
func (Matrix) Multiplied ¶
func (Matrix) TransformRect ¶
func (Matrix) Translated ¶
func (Matrix) TranslatedByPos ¶
type Path ¶
type Path struct {
Nodes []PathNode `json:",omitempty"`
}
func NewOvalPath ¶
func PathNewRect ¶
func (*Path) ArcDegFromCenter ¶
func (*Path) ForEachPart ¶
func (*Path) MoveOrLineTo ¶
func (*Path) QuadCurveTo ¶
func (*Path) Transformed ¶
type PathLineType ¶
type PathLineType int
const ( PathLineSquare PathLineType = iota PathLineRound PathLineButt )
func (*PathLineType) MarshalJSON ¶
func (p *PathLineType) MarshalJSON() ([]byte, error)
func (*PathLineType) UnmarshalJSON ¶
func (p *PathLineType) UnmarshalJSON(b []byte) error
type PathNode ¶
type PathNode struct { Type PathPartType Points []Pos `json:",omitempty"` }
type PathPartType ¶
type PathPartType int
const ( PathMove PathPartType = iota PathLine PathQuadCurve PathCurve PathClose )
func (*PathPartType) MarshalJSON ¶
func (p *PathPartType) MarshalJSON() ([]byte, error)
func (*PathPartType) UnmarshalJSON ¶
func (p *PathPartType) UnmarshalJSON(b []byte) error
type Pos ¶
func PosFromAngleDeg ¶
func PosFromGoPoint ¶
func PosFromString ¶
func TranslatePosInSystems ¶
func (Pos) ArcTanToRad ¶
func (Pos) DividedByD ¶
func (Pos) GetNormalized ¶
func (Pos) GetRot90CW ¶
func (Pos) IsSameDirection ¶
func (Pos) RotatedCCW ¶
func (Pos) ToAngleDeg ¶
func (*Pos) ZUISetFromString ¶
type Rect ¶
var ( RectUndef = RectFromWH(math.MaxFloat32, math.MaxFloat32) RectNull Rect )
func CellsSpanInBox ¶
CellsSpanInBox returns the number of *column* and *rows& *cellCount* cells of *cellSize* will span in *box*. It lays them out in rows first. If *cellCount* is <= 0, it returns for filling the box. size is the size these layed out cells will occupy.
func LayoutCellsInStack ¶
func LayoutCellsInStack(debugName string, rect Rect, vertical bool, spacing float64, cells []LayoutCell) []Rect
LayoutCellsInStack stacks cells horizontally or vertically in rect, returning resulting slice of rects in same slice positions as input cells.
func MergeAllOverlapping ¶
func RectFromCenterSize ¶
func RectFromGoRect ¶
func RectFromMarginSize ¶
func RectFromMinMax ¶
func RectFromWH ¶
func RectFromXY2 ¶
func RectFromXYWH ¶
func TranslateRectInSystems ¶
func (Rect) BottomLeft ¶
func (Rect) BottomRight ¶
func (Rect) DividedByD ¶
func (Rect) ExpandedToInt ¶
func (Rect) Intersected ¶
func (Rect) NormalizedNegativeSize ¶
func (Rect) Swapped ¶
Swapped returns a Rect where the vertical and horizontal components are swapped
func (*Rect) Translated ¶
func (*Rect) UnionWithPos ¶
func (Rect) UnionedWith ¶
type Size ¶
func LayoutGetCellsStackedSize ¶
func LayoutGetCellsStackedSize(debugName string, vertical bool, spacing float64, cells []LayoutCell) (s, max Size)
func SizeFromString ¶
func (Size) DividedByD ¶
func (Size) EqualSided ¶
EqualSided returns a Size where W and H are largest of the two
func (Size) ExpandedInto ¶
ExpandTo makes s just fit in 'in' proportionally, if smaller
func (Size) MarshalJSON ¶
func (*Size) MinimizeNonZero ¶
MinimizeNonZero sets s to minimum of s and a.
func (*Size) SetElement ¶
func (Size) ShrunkInto ¶
ShrunkInto makes s just fit in 'in' proportionally, if bigger
func (*Size) Subtract ¶
func (s Size) MultipliedBy(a Size) Size { return Size{s.W * a.W, s.H * a.H} } func (s Size) MultipliedByD(a float64) Size { return Size{s.W * a, s.H * a} }