Misc improvements to Bounds
in gpui geometry
* Makes `dilate` and `inset` return. * Implements `Add<Point<T>>` and `Sub<Point<T>>`. * Makes some trait constraints more precise.
This commit is contained in:
parent
a062c0f1bc
commit
ebf6804afd
2 changed files with 121 additions and 66 deletions
|
@ -2281,9 +2281,7 @@ impl<'a> WindowContext<'a> {
|
|||
let content_mask = self.content_mask();
|
||||
let opacity = self.element_opacity();
|
||||
for shadow in shadows {
|
||||
let mut shadow_bounds = bounds;
|
||||
shadow_bounds.origin += shadow.offset;
|
||||
shadow_bounds.dilate(shadow.spread_radius);
|
||||
let shadow_bounds = (bounds + shadow.offset).dilate(shadow.spread_radius);
|
||||
self.window.next_frame.scene.insert_primitive(Shadow {
|
||||
order: 0,
|
||||
blur_radius: shadow.blur_radius.scale(scale_factor),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue