summaryrefslogtreecommitdiffstats
path: root/wgpu
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-04-29 07:34:14 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-04-29 07:34:14 +0200
commit61c707fe044e7abc035f1a35697757f55f955417 (patch)
treed5c99fe78400bb51b2d97ebb9145e897e5f4473a /wgpu
parentdc51080328caa12d2b1fc02febc72cab70bb9f50 (diff)
parente0aa89cee764eebb1cb06f0b0653f82b337620ea (diff)
downloadiced-61c707fe044e7abc035f1a35697757f55f955417.tar.gz
iced-61c707fe044e7abc035f1a35697757f55f955417.tar.bz2
iced-61c707fe044e7abc035f1a35697757f55f955417.zip
Merge branch 'master' into feature/canvas-interaction
Diffstat (limited to 'wgpu')
-rw-r--r--wgpu/Cargo.toml2
-rw-r--r--wgpu/src/renderer.rs24
-rw-r--r--wgpu/src/renderer/widget/text.rs2
-rw-r--r--wgpu/src/widget.rs4
-rw-r--r--wgpu/src/widget/text.rs7
5 files changed, 26 insertions, 13 deletions
diff --git a/wgpu/Cargo.toml b/wgpu/Cargo.toml
index 0794b970..00f18472 100644
--- a/wgpu/Cargo.toml
+++ b/wgpu/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "iced_wgpu"
-version = "0.2.1"
+version = "0.2.2"
authors = ["Héctor Ramón Jiménez <hector0193@gmail.com>"]
edition = "2018"
description = "A wgpu renderer for Iced"
diff --git a/wgpu/src/renderer.rs b/wgpu/src/renderer.rs
index 5c38ce61..dccd0d82 100644
--- a/wgpu/src/renderer.rs
+++ b/wgpu/src/renderer.rs
@@ -355,6 +355,18 @@ impl Renderer {
) {
let bounds = layer.bounds * scale_factor;
+ if !layer.quads.is_empty() {
+ self.quad_pipeline.draw(
+ device,
+ encoder,
+ &layer.quads,
+ transformation,
+ scale_factor,
+ bounds,
+ target,
+ );
+ }
+
if !layer.meshes.is_empty() {
let scaled = transformation
* Transformation::scale(scale_factor, scale_factor);
@@ -371,18 +383,6 @@ impl Renderer {
);
}
- if !layer.quads.is_empty() {
- self.quad_pipeline.draw(
- device,
- encoder,
- &layer.quads,
- transformation,
- scale_factor,
- bounds,
- target,
- );
- }
-
#[cfg(any(feature = "image", feature = "svg"))]
{
if !layer.images.is_empty() {
diff --git a/wgpu/src/renderer/widget/text.rs b/wgpu/src/renderer/widget/text.rs
index 3cf32426..4a4ecef4 100644
--- a/wgpu/src/renderer/widget/text.rs
+++ b/wgpu/src/renderer/widget/text.rs
@@ -7,6 +7,8 @@ use iced_native::{
use std::f32;
impl text::Renderer for Renderer {
+ type Font = Font;
+
const DEFAULT_SIZE: u16 = 20;
fn measure(
diff --git a/wgpu/src/widget.rs b/wgpu/src/widget.rs
index c3a47dff..32ccad17 100644
--- a/wgpu/src/widget.rs
+++ b/wgpu/src/widget.rs
@@ -17,6 +17,8 @@ pub mod scrollable;
pub mod slider;
pub mod text_input;
+mod text;
+
#[doc(no_inline)]
pub use button::Button;
#[doc(no_inline)]
@@ -36,6 +38,8 @@ pub use slider::Slider;
#[doc(no_inline)]
pub use text_input::TextInput;
+pub use text::Text;
+
#[cfg(feature = "canvas")]
#[cfg_attr(docsrs, doc(cfg(feature = "canvas")))]
pub mod canvas;
diff --git a/wgpu/src/widget/text.rs b/wgpu/src/widget/text.rs
new file mode 100644
index 00000000..1053ea97
--- /dev/null
+++ b/wgpu/src/widget/text.rs
@@ -0,0 +1,7 @@
+//! Write some text for your users to read.
+use crate::Renderer;
+
+/// A paragraph of text.
+///
+/// This is an alias of an `iced_native` text with an `iced_wgpu::Renderer`.
+pub type Text = iced_native::Text<Renderer>;