Implement Canvas support for iced_tiny_skia
This commit is contained in:
parent
3f6e28fa9b
commit
5fd5d1cdf8
65 changed files with 1354 additions and 570 deletions
|
|
@ -5,8 +5,8 @@ use iced::widget::canvas::{
|
|||
self, stroke, Cache, Canvas, Cursor, Geometry, Path, Stroke,
|
||||
};
|
||||
use iced::{
|
||||
Application, Command, Element, Length, Point, Rectangle, Settings,
|
||||
Subscription, Theme,
|
||||
Application, Command, Element, Length, Point, Rectangle, Renderer,
|
||||
Settings, Subscription, Theme,
|
||||
};
|
||||
|
||||
pub fn main() -> iced::Result {
|
||||
|
|
@ -69,17 +69,18 @@ impl Application for Arc {
|
|||
}
|
||||
}
|
||||
|
||||
impl<Message> canvas::Program<Message> for Arc {
|
||||
impl<Message> canvas::Program<Message, Renderer> for Arc {
|
||||
type State = ();
|
||||
|
||||
fn draw(
|
||||
&self,
|
||||
_state: &Self::State,
|
||||
renderer: &Renderer,
|
||||
theme: &Theme,
|
||||
bounds: Rectangle,
|
||||
_cursor: Cursor,
|
||||
) -> Vec<Geometry> {
|
||||
let geometry = self.cache.draw(bounds.size(), |frame| {
|
||||
let geometry = self.cache.draw(renderer, bounds.size(), |frame| {
|
||||
let palette = theme.palette();
|
||||
|
||||
let center = frame.center();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue