Skip to content

Commit

Permalink
Readjusted namespaces, removed Geometry example as it's no longer rel…
Browse files Browse the repository at this point in the history
…evant.
  • Loading branch information
bungoboingo committed Oct 5, 2022
1 parent 6e7b3ce commit 30432cb
Show file tree
Hide file tree
Showing 27 changed files with 394 additions and 625 deletions.
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ members = [
"examples/events",
"examples/exit",
"examples/game_of_life",
"examples/geometry",
"examples/integration_opengl",
"examples/integration_wgpu",
"examples/modern_art",
Expand Down
4 changes: 2 additions & 2 deletions examples/arc/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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, Style,
self, stroke, Cache, Canvas, Cursor, Geometry, Path, Stroke,
};
use iced::{
Application, Command, Element, Length, Point, Rectangle, Settings,
Expand Down Expand Up @@ -114,7 +114,7 @@ impl<Message> canvas::Program<Message> for Arc {
frame.stroke(
&path,
Stroke {
style: Style::Solid(palette.text),
style: stroke::Style::Solid(palette.text),
width: 10.0,
..Stroke::default()
},
Expand Down
11 changes: 0 additions & 11 deletions examples/geometry/Cargo.toml

This file was deleted.

18 changes: 0 additions & 18 deletions examples/geometry/README.md

This file was deleted.

222 changes: 0 additions & 222 deletions examples/geometry/src/main.rs

This file was deleted.

9 changes: 4 additions & 5 deletions examples/modern_art/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
use rand::{Rng, thread_rng};
use crate::canvas::{Cursor, Geometry};
use iced::widget::canvas::{Cache, Fill, Frame};
use iced::widget::canvas::{Cache, Fill, Frame, Gradient};
use iced::widget::{canvas, Canvas};
use iced::Settings;
use iced::{
executor, Application, Color, Command, Element, Length, Point, Rectangle,
Renderer, Size, Theme,
};
use iced_graphics::gradient::Gradient;
use iced_graphics::widget::canvas::Style;
use iced_graphics::widget::canvas::fill;

fn main() -> iced::Result {
ModernArt::run(Settings {
Expand Down Expand Up @@ -121,7 +120,7 @@ fn generate_box(frame: &mut Frame, bounds: Size) -> bool {
top_left,
size,
Fill {
style: Style::Solid(random_color()),
style: fill::Style::Solid(random_color()),
.. Default::default()
}
);
Expand All @@ -130,7 +129,7 @@ fn generate_box(frame: &mut Frame, bounds: Size) -> bool {
top_left,
size,
Fill {
style: Style::Gradient(&gradient(
style: fill::Style::Gradient(&gradient(
top_left,
Point::new(top_left.x + size.width, top_left.y + size.height)
)),
Expand Down
10 changes: 5 additions & 5 deletions glow/src/triangle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ mod solid;
use crate::{program, Transformation};
use glow::HasContext;
use iced_graphics::layer::{attribute_count_of, Mesh};
use iced_graphics::shader;
use std::marker::PhantomData;
use iced_graphics::layer;

use crate::triangle::gradient::GradientProgram;
use crate::triangle::solid::SolidProgram;
pub use iced_graphics::triangle::{Mesh2D, Vertex2D};
use shader::Shader;
use layer::mesh;

#[derive(Debug)]
pub(crate) struct Pipeline {
Expand Down Expand Up @@ -139,11 +139,11 @@ impl Pipeline {
clip_bounds.height as i32,
);

match mesh.shader {
Shader::Solid(color) => {
match mesh.style {
mesh::Style::Solid(color) => {
self.programs.solid.use_program(gl, &color, &transform);
}
Shader::Gradient(gradient) => {
mesh::Style::Gradient(gradient) => {
self.programs.gradient.use_program(gl, &gradient, &transform);
}
}
Expand Down
Loading

0 comments on commit 30432cb

Please sign in to comment.