summaryrefslogtreecommitdiffstats
path: root/wgpu
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2023-12-02 15:53:02 +0100
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2023-12-02 15:56:28 +0100
commitb526ce4958b28208395276dd4078ffe0d780e1d7 (patch)
tree802fef9f0b54b6f9cbbeedff14d7f57169db7d6b /wgpu
parent43a7cc2222750b1cada1663b29278b29d3ea232c (diff)
downloadiced-b526ce4958b28208395276dd4078ffe0d780e1d7.tar.gz
iced-b526ce4958b28208395276dd4078ffe0d780e1d7.tar.bz2
iced-b526ce4958b28208395276dd4078ffe0d780e1d7.zip
Rename `viewport` to `clip_bounds`
Diffstat (limited to '')
-rw-r--r--wgpu/src/geometry.rs2
-rw-r--r--wgpu/src/layer.rs14
-rw-r--r--wgpu/src/layer/text.rs8
-rw-r--r--wgpu/src/text.rs14
4 files changed, 19 insertions, 19 deletions
diff --git a/wgpu/src/geometry.rs b/wgpu/src/geometry.rs
index c82b9ffb..e0bff67e 100644
--- a/wgpu/src/geometry.rs
+++ b/wgpu/src/geometry.rs
@@ -346,7 +346,7 @@ impl Frame {
horizontal_alignment: text.horizontal_alignment,
vertical_alignment: text.vertical_alignment,
shaping: text.shaping,
- viewport: bounds,
+ clip_bounds: Rectangle::with_size(Size::INFINITY),
});
}
diff --git a/wgpu/src/layer.rs b/wgpu/src/layer.rs
index 60da3543..557a7633 100644
--- a/wgpu/src/layer.rs
+++ b/wgpu/src/layer.rs
@@ -75,7 +75,7 @@ impl<'a> Layer<'a> {
horizontal_alignment: alignment::Horizontal::Left,
vertical_alignment: alignment::Vertical::Top,
shaping: core::text::Shaping::Basic,
- viewport: Rectangle::with_size(Size::INFINITY),
+ clip_bounds: Rectangle::with_size(Size::INFINITY),
};
overlay.text.push(Text::Cached(text.clone()));
@@ -124,7 +124,7 @@ impl<'a> Layer<'a> {
paragraph,
position,
color,
- viewport,
+ clip_bounds,
} => {
let layer = &mut layers[current_layer];
@@ -132,14 +132,14 @@ impl<'a> Layer<'a> {
paragraph: paragraph.clone(),
position: *position + translation,
color: *color,
- viewport: *viewport + translation,
+ clip_bounds: *clip_bounds + translation,
});
}
Primitive::Editor {
editor,
position,
color,
- viewport,
+ clip_bounds,
} => {
let layer = &mut layers[current_layer];
@@ -147,7 +147,7 @@ impl<'a> Layer<'a> {
editor: editor.clone(),
position: *position + translation,
color: *color,
- viewport: *viewport + translation,
+ clip_bounds: *clip_bounds + translation,
});
}
Primitive::Text {
@@ -160,7 +160,7 @@ impl<'a> Layer<'a> {
horizontal_alignment,
vertical_alignment,
shaping,
- viewport,
+ clip_bounds,
} => {
let layer = &mut layers[current_layer];
@@ -174,7 +174,7 @@ impl<'a> Layer<'a> {
horizontal_alignment: *horizontal_alignment,
vertical_alignment: *vertical_alignment,
shaping: *shaping,
- viewport: *viewport + translation,
+ clip_bounds: *clip_bounds + translation,
}));
}
Primitive::Quad {
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,
}
diff --git a/wgpu/src/text.rs b/wgpu/src/text.rs
index 7d73c87b..888b1924 100644
--- a/wgpu/src/text.rs
+++ b/wgpu/src/text.rs
@@ -120,12 +120,12 @@ impl Pipeline {
horizontal_alignment,
vertical_alignment,
color,
- viewport,
+ clip_bounds,
) = match section {
Text::Paragraph {
position,
color,
- viewport,
+ clip_bounds,
..
} => {
use crate::core::text::Paragraph as _;
@@ -141,13 +141,13 @@ impl Pipeline {
paragraph.horizontal_alignment(),
paragraph.vertical_alignment(),
*color,
- *viewport,
+ *clip_bounds,
)
}
Text::Editor {
position,
color,
- viewport,
+ clip_bounds,
..
} => {
use crate::core::text::Editor as _;
@@ -163,7 +163,7 @@ impl Pipeline {
alignment::Horizontal::Left,
alignment::Vertical::Top,
*color,
- *viewport,
+ *clip_bounds,
)
}
Text::Cached(text) => {
@@ -182,7 +182,7 @@ impl Pipeline {
text.horizontal_alignment,
text.vertical_alignment,
text.color,
- text.viewport,
+ text.clip_bounds,
)
}
};
@@ -206,7 +206,7 @@ impl Pipeline {
};
let clip_bounds =
- layer_bounds.intersection(&(viewport * scale_factor))?;
+ layer_bounds.intersection(&(clip_bounds * scale_factor))?;
Some(glyphon::TextArea {
buffer,