constraints

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 12, 2021 License: Unlicense Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FPt

func FPt(p image.Point) f32.Point

FPt converts an point to a f32.Point.

func FRect

func FRect(r image.Rectangle) f32.Rectangle

FRect converts a rectangle to a f32.Rectangle.

Types

type Constraints

type Constraints struct {
	Min, Max image.Point
}

Constraints define the minimum and maximum dimensions of a layout area

func Exact

func Exact(size image.Point) Constraints

Exact returns the Constraints with the minimum and maximum size set to size.

func (Constraints) Constrain

func (c Constraints) Constrain(size image.Point) image.Point

Constrain a size so each dimension is in the range [min;max].

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL