-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot extend Rectangle? #273
Comments
Rectangle is NSRect (https://developer.apple.com/documentation/foundation/nsrect) under the hood. It’s a struct and not an object, so that’s the reason you get the error. I’m surprised nobody else has noticed this from documentation before. 😄 I’ll fix that. |
Ah, ok. So I can't override it and do nice things like I do for |
@rcarmo You can of course pass it to functions, in a more functional approach. const pad = (rect) => ({
...rect,
x: rect.x + PADDING,
}); |
Yeah, I wanted to make it smarter. Am now using something called a |
… simple struct objects and not being extendable (#273)
I’ve clarified the documentation in this regard. |
So I'm trying to extend Rectangle:
... and I get
ReferenceError: Can't find variable: Rectangle (Line:Column)
Since I can hack
Screen
, shouldn't I be able to do the same forRectangle
, so that I can take aWindow.frame
and manipulate it directly like this?The text was updated successfully, but these errors were encountered: