HSRect
Type
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.
Properties
x
number
An x-axis coordinate for the top-left point of the rectangle
y
number
A y-axis coordinate for the top-left point of the rectangle
origin
HSPoint
The "origin" of the rectangle, ie the coordinates of its top left corner, as an HSPoint object
size
HSSize
The size of the rectangle, ie its width and height, as an HSSize object
Methods
constructor(x, y, w, h)
Create a new HSRect object
Hammerspoon 2/Engine/Types/HSRect.swift:42
Parameters
-
xnumberThe x-axis coordinate of the top-left corner
-
ynumberThe y-axis coordinate of the top-left corner
-
wnumberThe width of the rectangle
-
hnumberThe height of the rectangle
Returns
Nothing