🐛 Fix path rotation

This commit is contained in:
Belén Albeza 2024-12-13 13:03:23 +01:00
parent d4b829ed19
commit e1c5cd6640
4 changed files with 110 additions and 76 deletions

View file

@ -1,6 +1,6 @@
use skia_safe as skia;
#[derive(Debug, Clone, Copy)]
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct Matrix {
pub a: f32,
pub b: f32,
@ -47,6 +47,15 @@ impl Matrix {
res
}
pub fn no_translation(&self) -> Self {
let mut res = Self::identity();
res.c = self.c;
res.b = self.b;
res.a = self.a;
res.d = self.d;
res
}
fn translation(&self) -> (f32, f32) {
(self.e, self.f)
}