implement text support in canvas widget

This commit is contained in:
Artur Sapek 2020-03-05 22:05:05 -07:00 committed by Artur Sapek
parent 29219500b7
commit 1bb8555691
5 changed files with 80 additions and 31 deletions

View file

@ -3,10 +3,9 @@ mod cache;
pub use cache::Cache;
use crate::triangle;
use crate::Primitive;
use iced_native::Size;
use std::sync::Arc;
use iced_native::{Point, Size};
/// A layer that can be presented at a [`Canvas`].
///
@ -21,5 +20,5 @@ pub trait Layer: std::fmt::Debug {
///
/// [`Layer`]: trait.Layer.html
/// [`Mesh2D`]: ../../../triangle/struct.Mesh2D.html
fn draw(&self, bounds: Size) -> Arc<triangle::Mesh2D>;
fn draw(&self, origin: Point, bounds: Size) -> Primitive;
}