Crates.io | glissade-macro |
lib.rs | glissade-macro |
version | 0.1.2 |
source | src |
created_at | 2024-06-24 04:45:08.277521 |
updated_at | 2024-07-19 19:00:01.387563 |
description | Derive macro for implementing glissade::Mix trait |
homepage | |
repository | https://github.com/monkin/glissade |
max_upload_size | |
id | 1281818 |
size | 5,704 |
Glissade macro is a Rust crate that provides Mix
derive macro
for the glissade
library.
See the https://github.com/monkin/glissade for more information.
use glissade::Mix;
#[derive(Mix, PartialEq, Debug)]
struct Touch {
x: f32,
y: f32,
pressure: u8,
}
let touch1 = Touch { x: 0.0, y: 0.0, pressure: 0 };
let touch2 = Touch { x: 100.0, y: 100.0, pressure: 200 };
let touch_mix = touch1.mix(touch2, 0.5);
assert_eq!(touch_mix, Touch { x: 50.0, y: 50.0, pressure: 100 });
This project is licensed under the MIT License.