Reworked wgpu buffers, updated glow side to have proper transform location storage, attempting to fix visibility modifiers, implemented some of the feedback received in initial PR.

This commit is contained in:
shan 2022-10-04 18:24:46 -07:00
parent 5d0fffc626
commit 6e7b3ced0b
20 changed files with 411 additions and 417 deletions

View file

@ -2,7 +2,7 @@ use std::{f32::consts::PI, time::Instant};
use iced::executor;
use iced::widget::canvas::{
self, Cache, Canvas, Cursor, Geometry, Path, Stroke, StrokeStyle,
self, Cache, Canvas, Cursor, Geometry, Path, Stroke, Style,
};
use iced::{
Application, Command, Element, Length, Point, Rectangle, Settings,
@ -114,7 +114,7 @@ impl<Message> canvas::Program<Message> for Arc {
frame.stroke(
&path,
Stroke {
style: StrokeStyle::Solid(palette.text),
style: Style::Solid(palette.text),
width: 10.0,
..Stroke::default()
},

View file

@ -1,6 +1,6 @@
use iced::executor;
use iced::widget::canvas::{
Cache, Cursor, Geometry, LineCap, Path, Stroke, StrokeStyle,
Cache, Cursor, Geometry, LineCap, Path, Stroke, Style,
};
use iced::widget::{canvas, container};
use iced::{
@ -111,7 +111,7 @@ impl<Message> canvas::Program<Message> for Clock {
let thin_stroke = || -> Stroke {
Stroke {
width,
style: StrokeStyle::Solid(Color::WHITE),
style: Style::Solid(Color::WHITE),
line_cap: LineCap::Round,
..Stroke::default()
}
@ -120,7 +120,7 @@ impl<Message> canvas::Program<Message> for Clock {
let wide_stroke = || -> Stroke {
Stroke {
width: width * 3.0,
style: StrokeStyle::Solid(Color::WHITE),
style: Style::Solid(Color::WHITE),
line_cap: LineCap::Round,
..Stroke::default()
}

View file

@ -1,5 +1,5 @@
use rand::{Rng, thread_rng};
use crate::canvas::{Cursor, FillStyle, Geometry};
use crate::canvas::{Cursor, Geometry};
use iced::widget::canvas::{Cache, Fill, Frame};
use iced::widget::{canvas, Canvas};
use iced::Settings;
@ -8,6 +8,7 @@ use iced::{
Renderer, Size, Theme,
};
use iced_graphics::gradient::Gradient;
use iced_graphics::widget::canvas::Style;
fn main() -> iced::Result {
ModernArt::run(Settings {
@ -120,7 +121,7 @@ fn generate_box(frame: &mut Frame, bounds: Size) -> bool {
top_left,
size,
Fill {
style: FillStyle::Solid(random_color()),
style: Style::Solid(random_color()),
.. Default::default()
}
);
@ -129,7 +130,7 @@ fn generate_box(frame: &mut Frame, bounds: Size) -> bool {
top_left,
size,
Fill {
style: FillStyle::Gradient(&gradient(
style: Style::Gradient(&gradient(
top_left,
Point::new(top_left.x + size.width, top_left.y + size.height)
)),

View file

@ -19,7 +19,7 @@ use iced::{
};
use std::time::Instant;
use crate::canvas::StrokeStyle;
use crate::canvas::Style;
pub fn main() -> iced::Result {
SolarSystem::run(Settings {
@ -179,7 +179,7 @@ impl<Message> canvas::Program<Message> for State {
frame.stroke(
&orbit,
Stroke {
style: StrokeStyle::Solid(Color::from_rgba8(0, 153, 255, 0.1)),
style: Style::Solid(Color::from_rgba8(0, 153, 255, 0.1)),
width: 1.0,
line_dash: canvas::LineDash {
offset: 0,