Merge branch 'master' into feature/canvas-interaction
This commit is contained in:
commit
61c707fe04
18 changed files with 147 additions and 39 deletions
|
|
@ -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() {
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
7
wgpu/src/widget/text.rs
Normal file
7
wgpu/src/widget/text.rs
Normal file
|
|
@ -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>;
|
||||
Loading…
Add table
Add a link
Reference in a new issue