Vivid.Bounds.Of protocol (vivid v0.4.5)

Copy Markdown View Source

This protocol is used to calculate the bounds of a given shape.

Implement this protocol if you are defining any new shape types.

Summary

Types

t()

All the types that implement this protocol.

Functions

Return the bounds of a Shape as a two element tuple of bottom-left and top-right points.

Types

t()

@type t() :: term()

All the types that implement this protocol.

Functions

bounds(shape)

@spec bounds(Vivid.Shape.t()) :: {Vivid.Point.t(), Vivid.Point.t()}

Return the bounds of a Shape as a two element tuple of bottom-left and top-right points.