Skip to content

Commit

Permalink
Merge branch 'fsundvik/glamour' into fsundvik/wgpu-winit-0.30
Browse files Browse the repository at this point in the history
  • Loading branch information
fredizzimo committed Jul 13, 2024
2 parents 4659a7a + 72cd7d9 commit 73d5e6f
Show file tree
Hide file tree
Showing 13 changed files with 193 additions and 206 deletions.
83 changes: 36 additions & 47 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,9 @@ copypasta = "0.10.1"
csscolorparser = "0.6.2"
derive-new = "0.6.0"
dirs = "5.0.0"
euclid = { version = "0.22.9", features = ["serde", "mint"] }
glamour = { version = "0.11.1", features = ["serde"] }
flexi_logger = { version = "0.28.0", default-features = false }
futures = "0.3.21"
glam = { version = "0.22.0", features = ["mint"] }
glutin = "0.31.1"
glutin-winit = "0.4.2"
image = { version = "0.25.0", default-features = false, features = ["ico"] }
Expand Down
12 changes: 6 additions & 6 deletions src/renderer/animation_utils.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::units::PixelPos;
use glamour::{Point2, Unit};

#[allow(dead_code)]
pub fn ease_linear(t: f32) -> f32 {
Expand Down Expand Up @@ -73,13 +73,13 @@ pub fn ease(ease_func: fn(f32) -> f32, start: f32, end: f32, t: f32) -> f32 {
lerp(start, end, ease_func(t))
}

pub fn ease_point(
pub fn ease_point<T: Unit<Scalar = f32>>(
ease_func: fn(f32) -> f32,
start: PixelPos<f32>,
end: PixelPos<f32>,
start: Point2<T>,
end: Point2<T>,
t: f32,
) -> PixelPos<f32> {
PixelPos::new(
) -> Point2<T> {
Point2::new(
ease(ease_func, start.x, end.x, t),
ease(ease_func, start.y, end.y, t),
)
Expand Down
7 changes: 3 additions & 4 deletions src/renderer/cursor_renderer/cursor_vfx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use crate::{
renderer::cursor_renderer::CursorSettings,
renderer::{animation_utils::*, grid_renderer::GridRenderer},
settings::*,
units::{PixelPos, PixelSize, PixelVec},
units::{GridSize, PixelPos, PixelSize, PixelVec},
};

pub trait CursorVfx {
Expand Down Expand Up @@ -136,7 +136,7 @@ impl CursorVfx for PointHighlight {
//
// paint.set_color(color);
//
// let cursor_height = grid_renderer.grid_scale.0.height;
// let cursor_height = grid_renderer.grid_scale.height();
// let size = 3.0 * cursor_height;
// let radius = self.t * size;
// let hr = radius * 0.5;
Expand All @@ -161,7 +161,6 @@ impl CursorVfx for PointHighlight {
// paint.set_stroke_width(cursor_height * 0.2);
// canvas.draw_rect(rect, &paint);
// }
// }
}
}

Expand Down Expand Up @@ -316,7 +315,7 @@ impl CursorVfx for ParticleTrail {

fn render(&self, settings: &CursorSettings, grid_renderer: &mut GridRenderer, cursor: &Cursor) {
// let mut paint = Paint::new(skia_safe::colors::WHITE, None);
// let font_dimensions = grid_renderer.grid_scale.0;
// let font_dimensions = GridSize::new(1.0, 1.0) * grid_renderer.grid_scale;
// match self.trail_mode {
// TrailMode::Torpedo | TrailMode::Railgun => {
// paint.set_style(Style::Stroke);
Expand Down
Loading

0 comments on commit 73d5e6f

Please sign in to comment.