9 Point, Size, and Rectangle
class | |
| |
annotation | |
| |
| |
annotation | |
| |
| |
function | |
| |
value | |
Methods that expect a point typically accept a value satisfying PointLike, which is any of the following:
matching([_ :: Real, _ :: Real]): a List containing two Real values; or
matching({#'x: _ :: Real, #'y: _ :: Real}): a Map containing at least the keys #'x and #'y, each mapped to a Real value.
The PointLike.to_point annotation is satisfied by any value that satisfis PointLike, and the value is converted to an equivalent Point object if it is not one already.
The PointLike.to_point function converts a PointLike value to a Point, like the PointLike.to_point annotation. An expression pt with static information from PointLike can call PointLike.to_point(pt) using pt.to_point().
Point.zero is a Point object with 0 values.
class | |
| |
| |
annotation | |
| |
| |
annotation | |
| |
| |
function | |
| |
value | |
Methods that expect a size typically accept a value satisfying SizeLike, which is any of the following:
matching([_ :: NonnegReal, _ :: NonnegReal]): a List containing two NonnegReal values; or
matching({#'width: _ :: NonnegReal, #'height: _ :: NonnegReal}): a Map containing at least the keys #'width and #'height, each mapped to a NonnegReal value.
The SizeLike.to_size annotation, SizeLike.to_size function, and Size.zero value are anaologous to PointLike.to_point, PointLike.to_point, and Point.zero.
class | ||||||
| ||||||
| ||||||
property | ||||||
| ||||||
property | ||||||
| ||||||
annotation | ||||||
| ||||||
| ||||||
annotation | ||||||
| ||||||
| ||||||
function | ||||||
| ||||||
value | ||||||
Methods that expect a rectangle typically accept a value satisfying RectLike, which is any of the following:
a Rect instance;
matching([_ :: Real, _ :: Real, _ :: NonnegReal, _ :: NonnegReal]): a List containing two Real values for the top-left point followed by two NonnegReal values for the size;
matching([_ :: PointLike, _ :: SizeLike]): a List containing a PointLike value followed by a SizeLike value;
matching({#'x: _ :: Real, #'y: _ :: Real, #'width: _ :: NonnegReal, #'height: _ :: NonnegReal}): a Map containing at least the keys #'x, #'y, #'width, and #'height, where each of the first two are mapped to a Real value, and each of the last two are mapped to a NonnegReal value; or
matching({#'point: _ :: PointLike, #'size: _ :: SizeLike}): a Map containing at least the keys #'point and #'size, where the first is mapped to a PointLike value and the second is mapped to a SizeLike value.
The RectLike.to_rect annotation, RectLike.to_rect function, and Rect.zero value are anaologous to PointLike.to_point, PointLike.to_point, and Point.zero.
class | |||
| |||
method | |||
| |||
| |||
method | |||
| |||
method | |||
| |||
method | |||
|
xx: a scale from the logical x to the device x
yx: a scale from the logical y added to the device x
xy: a scale from the logical x added to the device y
yy: a scale from the logical y to the device y
x0: an additional amount added to the device x
y0: an additional amount added to the device y
The Transformation.translate, Transformation.scale, Transformation.rotate, and Transformation.transform methods produce a new Transformation object that represents the starting transformation followed by an additional one.
annotation | |