Create a new HSRect object
The x-axis coordinate of the top-left corner
The y-axis coordinate of the top-left corner
The width of the rectangle
The height of the rectangle
The height of the rectangle
The "origin" of the rectangle, ie the coordinates of its top left corner, as an HSPoint object
The size of the rectangle, ie its width and height, as an HSSize object
The width of the rectangle
An x-axis coordinate for the top-left point of the rectangle
A y-axis coordinate for the top-left point of the rectangle
Returns the angle between the positive x axis and the vector from this rect's center to another point or rect's center
A number containing the angle in radians, or 0 if other is not an HSPoint or HSRect
Checks if this rect is equal to another rect
An HSRect to compare against
true if both rects have the same origin and size, otherwise false
Truncates the origin and size of this rect towards negative infinity
A new HSRect with the x, y, w and h values floored to the nearest integer
Converts a unit rect (coordinates and dimensions between 0 and 1) within a given frame into absolute coordinates
An HSRect describing the frame this unit rect is relative to
A new HSRect with coordinates and dimensions converted from the 0-1 range into absolute values within frame
Checks if this rect lies fully inside another rect
An HSRect to check against
true if this rect lies fully within the bounds of rect, otherwise false
Scales the size of this rect, keeping its center constant
A new HSRect scaled by the given factor, or an unchanged copy of this rect if factor is not a positive number, HSSize or HSPoint
This is a JavaScript object used to represent a rectangle, as used in various places throughout Hammerspoon's API, particularly where dealing with portions of a display. Behind the scenes it is a wrapper for the CGRect type in Swift/ObjectiveC.