Add Corner to geometry and make names of corner methods consistent (#22119)
Release Notes: - N/A
This commit is contained in:
parent
3052fc2565
commit
fc5a810408
39 changed files with 325 additions and 254 deletions
|
@ -218,13 +218,13 @@ impl Render for GradientViewer {
|
|||
let height = square_bounds.size.height;
|
||||
let horizontal_offset = height;
|
||||
let vertical_offset = px(30.);
|
||||
let mut path = gpui::Path::new(square_bounds.lower_left());
|
||||
let mut path = gpui::Path::new(square_bounds.bottom_left());
|
||||
path.line_to(square_bounds.origin + point(horizontal_offset, vertical_offset));
|
||||
path.line_to(
|
||||
square_bounds.upper_right() + point(-horizontal_offset, vertical_offset),
|
||||
square_bounds.top_right() + point(-horizontal_offset, vertical_offset),
|
||||
);
|
||||
path.line_to(square_bounds.lower_right());
|
||||
path.line_to(square_bounds.lower_left());
|
||||
path.line_to(square_bounds.bottom_right());
|
||||
path.line_to(square_bounds.bottom_left());
|
||||
cx.paint_path(
|
||||
path,
|
||||
linear_gradient(
|
||||
|
|
|
@ -49,17 +49,17 @@ impl PaintingViewer {
|
|||
let height = square_bounds.size.height;
|
||||
let horizontal_offset = height;
|
||||
let vertical_offset = px(30.);
|
||||
let mut path = Path::new(square_bounds.lower_left());
|
||||
let mut path = Path::new(square_bounds.bottom_left());
|
||||
path.curve_to(
|
||||
square_bounds.origin + point(horizontal_offset, vertical_offset),
|
||||
square_bounds.origin + point(px(0.0), vertical_offset),
|
||||
);
|
||||
path.line_to(square_bounds.upper_right() + point(-horizontal_offset, vertical_offset));
|
||||
path.line_to(square_bounds.top_right() + point(-horizontal_offset, vertical_offset));
|
||||
path.curve_to(
|
||||
square_bounds.lower_right(),
|
||||
square_bounds.upper_right() + point(px(0.0), vertical_offset),
|
||||
square_bounds.bottom_right(),
|
||||
square_bounds.top_right() + point(px(0.0), vertical_offset),
|
||||
);
|
||||
path.line_to(square_bounds.lower_left());
|
||||
path.line_to(square_bounds.bottom_left());
|
||||
lines.push(path);
|
||||
|
||||
Self {
|
||||
|
|
|
@ -86,7 +86,7 @@ fn main() {
|
|||
.unwrap();
|
||||
|
||||
let bounds = Bounds {
|
||||
origin: screen.bounds().upper_right()
|
||||
origin: screen.bounds().top_right()
|
||||
- point(size.width + margin_offset, -margin_offset),
|
||||
size,
|
||||
};
|
||||
|
@ -101,7 +101,7 @@ fn main() {
|
|||
.unwrap();
|
||||
|
||||
let bounds = Bounds {
|
||||
origin: screen.bounds().lower_left()
|
||||
origin: screen.bounds().bottom_left()
|
||||
- point(-margin_offset, size.height + margin_offset),
|
||||
size,
|
||||
};
|
||||
|
@ -116,7 +116,7 @@ fn main() {
|
|||
.unwrap();
|
||||
|
||||
let bounds = Bounds {
|
||||
origin: screen.bounds().lower_right()
|
||||
origin: screen.bounds().bottom_right()
|
||||
- point(size.width + margin_offset, size.height + margin_offset),
|
||||
size,
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue