From 3d737fd2681ee62616c5031a8fa3717c6fd56f21 Mon Sep 17 00:00:00 2001 From: Jason Lee Date: Tue, 6 May 2025 12:17:39 +0800 Subject: [PATCH] gpui: Update argument name of the `from_corners` method (#29968) Release Notes: - N/A --- crates/gpui/src/geometry.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/crates/gpui/src/geometry.rs b/crates/gpui/src/geometry.rs index f2d11029156f37d577b71d644a89cec95eda758d..e4e88bd58d60d9c96a329553aba2b3b7fc9f78c5 100644 --- a/crates/gpui/src/geometry.rs +++ b/crates/gpui/src/geometry.rs @@ -804,7 +804,7 @@ where /// /// # Arguments /// - /// * `upper_left` - A `Point` representing the top left corner of the rectangle. + /// * `top_left` - A `Point` representing the top left corner of the rectangle. /// * `bottom_right` - A `Point` representing the bottom right corner of the rectangle. /// /// # Returns @@ -815,22 +815,22 @@ where /// /// ``` /// # 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 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.height, 10); /// ``` - pub fn from_corners(upper_left: Point, bottom_right: Point) -> Self { + pub fn from_corners(top_left: Point, bottom_right: Point) -> Self { let origin = Point { - x: upper_left.x.clone(), - y: upper_left.y.clone(), + x: top_left.x.clone(), + y: top_left.y.clone(), }; let size = Size { - width: bottom_right.x - upper_left.x, - height: bottom_right.y - upper_left.y, + width: bottom_right.x - top_left.x, + height: bottom_right.y - top_left.y, }; Bounds { origin, size } }