Add Image rotation support

Co-authored-by: DKolter <68352124+DKolter@users.noreply.github.com>
This commit is contained in:
Héctor Ramón Jiménez 2024-05-02 13:15:17 +02:00
parent aae8e4f5cf
commit 09a6bcfffc
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
19 changed files with 374 additions and 84 deletions

View file

@ -4,6 +4,7 @@ use crate::graphics::text;
use resvg::usvg::{self, TreeTextToPath};
use rustc_hash::{FxHashMap, FxHashSet};
use tiny_skia::Transform;
use std::cell::RefCell;
use std::collections::hash_map;
@ -34,6 +35,7 @@ impl Pipeline {
color: Option<Color>,
bounds: Rectangle,
pixels: &mut tiny_skia::PixmapMut<'_>,
transform: Transform,
clip_mask: Option<&tiny_skia::Mask>,
) {
if let Some(image) = self.cache.borrow_mut().draw(
@ -46,7 +48,7 @@ impl Pipeline {
bounds.y as i32,
image,
&tiny_skia::PixmapPaint::default(),
tiny_skia::Transform::identity(),
transform,
clip_mask,
);
}