-
Notifications
You must be signed in to change notification settings - Fork 326
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
Implementation of EnsoGL predefined Rectangle shape. #6033
Conversation
let canvas_clip_height_diff = &canvas_height * (clip.y() * 2.0); | ||
let canvas_clip_width_diff = &canvas_width * (clip.x() * 2.0); | ||
let canvas_height = canvas_height + &canvas_clip_height_diff; | ||
let canvas_width = canvas_width + &canvas_clip_width_diff; |
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.
not clear variable names
let canvas_width = canvas_width + &canvas_clip_width_diff; | ||
|
||
// === Body === | ||
let inset2 = (&inset * 2.0).px(); |
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.
Maybe padding is better than inset?
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'll leave inset here, as we discussed, as this is term used in CSS and Swift. Padding is used in display objects and it will get confusing if we will use it here as well, especially, as this shape implements display object.
* develop: Layout fixes (#6066) Use new Enso Hash Codes and Comparable (#6060) Search suggestions by static attribute (#6036) Use .node-version for pinning Node.js version (#6057) Fix code generation for suggestion preview (#6054) Implementation of EnsoGL predefined Rectangle shape. (#6033) Tidy up the public module level statics (#6032) Cursor aware Component Browser (#5770)
Pull Request Description
This PR implements a "super-shape",
Rectangle
. This shape has been specifically designed to be utilized across various sections of the GUI. Its numerous parameters enable a highly adaptable approach to drawing a diverse range of shapes, such as circles, rings, or ring segments. The advantage of having a singular shape for these cases is that a single draw call can be used to render multiple GUI elements, which ultimately enhances performance.Screen.Recording.2023-03-22.at.07.26.31.mov
Important Notes
unify_exclusive
, allowing blending their colors based on the foreground shape's SDF value. This means that even if these shapes overlap and the foreground is semi-transparent, it will blend with the background only in the anti-aliased areas. This allows us to render both rectangle and its border without artifacts between them, no matter the scene zoom level or camera transformation.Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Scala,
Java,
and
Rust
style guides. In case you are using a language not listed above, follow the Rust style guide.
./run ide build
.