Introduce Svg struct in core::svg

This commit is contained in:
Héctor Ramón Jiménez 2024-08-04 04:52:55 +02:00
parent 8708101c89
commit d4b08462e5
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
18 changed files with 146 additions and 257 deletions

View file

@ -580,13 +580,7 @@ impl Engine {
);
}
#[cfg(feature = "svg")]
Image::Vector {
handle,
color,
bounds,
rotation,
opacity,
} => {
Image::Vector(svg, bounds) => {
let physical_bounds = *bounds * _transformation;
if !_clip_bounds.intersects(&physical_bounds) {
@ -597,7 +591,7 @@ impl Engine {
.then_some(_clip_mask as &_);
let center = physical_bounds.center();
let radians = f32::from(*rotation);
let radians = f32::from(svg.rotation);
let transform = into_transform(_transformation).post_rotate_at(
radians.to_degrees(),
@ -606,10 +600,10 @@ impl Engine {
);
self.vector_pipeline.draw(
handle,
*color,
&svg.handle,
svg.color,
physical_bounds,
*opacity,
svg.opacity,
_pixels,
transform,
clip_mask,