rectangle

package
v0.0.0-...-e57d4e3 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Data

type Data struct {
	Left, Top, Right, Bottom int64
}

Data of the rectangle

func CreateFromLTRB

func CreateFromLTRB(left, top, right, bottom int64) Data

CreateFromLTRB from: x-coordinate of the upper-left corner, y-coordinate of the upper-left corner, x-coordinate of the lower-right corner, y-coordinate of the lower-right corner

func (Data) Empty

func (data Data) Empty() bool

Empty if the rectangle is not initialised/has zero area

func (Data) Height

func (data Data) Height() int64

Height of rectangle calculated from top - bottom

func (Data) Inflate

func (data Data) Inflate(x, y int64) Data

Inflate the rectangle keeping the geometric centre and return this new rectangle

func (Data) Width

func (data Data) Width() int64

Width of rectangle calculated from left - right

Jump to

Keyboard shortcuts

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