From 936d480267578d7e80675e78ec1880aaaaab72d6 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Fri, 1 Dec 2023 16:04:27 +0100 Subject: Clip text to `viewport` bounds instead of layout bounds --- wgpu/src/layer/text.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'wgpu/src/layer/text.rs') diff --git a/wgpu/src/layer/text.rs b/wgpu/src/layer/text.rs index 66417cec..c4ea9185 100644 --- a/wgpu/src/layer/text.rs +++ b/wgpu/src/layer/text.rs @@ -13,6 +13,7 @@ pub enum Text<'a> { paragraph: paragraph::Weak, position: Point, color: Color, + viewport: Rectangle, }, /// An editor. #[allow(missing_docs)] @@ -20,6 +21,7 @@ pub enum Text<'a> { editor: editor::Weak, position: Point, color: Color, + viewport: Rectangle, }, /// A cached text. Cached(Cached<'a>), @@ -53,4 +55,7 @@ pub struct Cached<'a> { /// The shaping strategy of the text. pub shaping: text::Shaping, + + /// The viewport of the text. + pub viewport: Rectangle, } -- cgit From b526ce4958b28208395276dd4078ffe0d780e1d7 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Sat, 2 Dec 2023 15:53:02 +0100 Subject: Rename `viewport` to `clip_bounds` --- wgpu/src/layer/text.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'wgpu/src/layer/text.rs') diff --git a/wgpu/src/layer/text.rs b/wgpu/src/layer/text.rs index c4ea9185..df2f2875 100644 --- a/wgpu/src/layer/text.rs +++ b/wgpu/src/layer/text.rs @@ -13,7 +13,7 @@ pub enum Text<'a> { paragraph: paragraph::Weak, position: Point, color: Color, - viewport: Rectangle, + clip_bounds: Rectangle, }, /// An editor. #[allow(missing_docs)] @@ -21,7 +21,7 @@ pub enum Text<'a> { editor: editor::Weak, position: Point, color: Color, - viewport: Rectangle, + clip_bounds: Rectangle, }, /// A cached text. Cached(Cached<'a>), @@ -56,6 +56,6 @@ pub struct Cached<'a> { /// The shaping strategy of the text. pub shaping: text::Shaping, - /// The viewport of the text. - pub viewport: Rectangle, + /// The clip bounds of the text. + pub clip_bounds: Rectangle, } -- cgit