gpui: Update argument name of the from_corners
method (#29968)
Release Notes: - N/A
This commit is contained in:
parent
c5d8407df4
commit
3d737fd268
1 changed files with 9 additions and 9 deletions
|
@ -804,7 +804,7 @@ where
|
||||||
///
|
///
|
||||||
/// # Arguments
|
/// # Arguments
|
||||||
///
|
///
|
||||||
/// * `upper_left` - A `Point<T>` representing the top left corner of the rectangle.
|
/// * `top_left` - A `Point<T>` representing the top left corner of the rectangle.
|
||||||
/// * `bottom_right` - A `Point<T>` representing the bottom right corner of the rectangle.
|
/// * `bottom_right` - A `Point<T>` representing the bottom right corner of the rectangle.
|
||||||
///
|
///
|
||||||
/// # Returns
|
/// # Returns
|
||||||
|
@ -815,22 +815,22 @@ where
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// # use gpui::{Bounds, Point};
|
/// # use gpui::{Bounds, Point};
|
||||||
/// let upper_left = Point { x: 0, y: 0 };
|
/// let top_left = Point { x: 0, y: 0 };
|
||||||
/// let bottom_right = Point { x: 10, y: 10 };
|
/// let bottom_right = Point { x: 10, y: 10 };
|
||||||
/// let bounds = Bounds::from_corners(upper_left, bottom_right);
|
/// let bounds = Bounds::from_corners(top_left, bottom_right);
|
||||||
///
|
///
|
||||||
/// assert_eq!(bounds.origin, upper_left);
|
/// assert_eq!(bounds.origin, top_left);
|
||||||
/// assert_eq!(bounds.size.width, 10);
|
/// assert_eq!(bounds.size.width, 10);
|
||||||
/// assert_eq!(bounds.size.height, 10);
|
/// assert_eq!(bounds.size.height, 10);
|
||||||
/// ```
|
/// ```
|
||||||
pub fn from_corners(upper_left: Point<T>, bottom_right: Point<T>) -> Self {
|
pub fn from_corners(top_left: Point<T>, bottom_right: Point<T>) -> Self {
|
||||||
let origin = Point {
|
let origin = Point {
|
||||||
x: upper_left.x.clone(),
|
x: top_left.x.clone(),
|
||||||
y: upper_left.y.clone(),
|
y: top_left.y.clone(),
|
||||||
};
|
};
|
||||||
let size = Size {
|
let size = Size {
|
||||||
width: bottom_right.x - upper_left.x,
|
width: bottom_right.x - top_left.x,
|
||||||
height: bottom_right.y - upper_left.y,
|
height: bottom_right.y - top_left.y,
|
||||||
};
|
};
|
||||||
Bounds { origin, size }
|
Bounds { origin, size }
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue