-
Notifications
You must be signed in to change notification settings - Fork 805
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
Adding --depth option to border command to recursively border subviews #126
Conversation
Interesting idea, thanks! We'll get this reviewed soon. |
layer = viewHelpers.convertToLayer(view) | ||
setBorder(layer, options.width, color, colorClassName) | ||
else: | ||
assert depth <= 0, "Recursive bordering is only supported for UIViews" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you want to have two separate asserts? One on the class, and another on depth?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please elaborate a bit, or give an example? Notice that I've changed the code a bit in a new commit, but assert still in place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like it should be something more like:
assert true, "Recursive bordering is only supported for UIViews"
assert depth <= 0, "Recursive bordering requires a depth greater than 0"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There might be a misunderstanding here. The purpose of this assert is to make sure recursive bordering is not used for layers (or anything that's not a UIView or NSView). However regular bordering is still permitted for layers. So if you're in the code path that takes you to this else block, we should validate that depth
is not provided to make sure recursive bordering won't happen.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. It reads like it's assert bad values on the depth, yet giving an unrelated error message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. It reads like it asserts bad values on the depth, yet giving an unrelated error message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I'll add a comment that should make it clearer.
Thanks @eithanshavit 💚 |
Oops, wrong button. |
Adding --depth option to border command to recursively border subviews
No description provided.