mirror of
https://github.com/penpot/penpot.git
synced 2025-12-11 22:14:05 +01:00
🐛 Fix svg attrs
Some checks failed
Commit Message Check / Check Commit Message (push) Has been cancelled
CI / Code Linter (push) Has been cancelled
CI / Common Tests (push) Has been cancelled
CI / Frontend Tests (push) Has been cancelled
CI / Render WASM Tests (push) Has been cancelled
CI / Backend Tests (push) Has been cancelled
CI / Library Tests (push) Has been cancelled
CI / Build Integration Bundle (push) Has been cancelled
CI / Integration Tests 1/4 (push) Has been cancelled
CI / Integration Tests 2/4 (push) Has been cancelled
CI / Integration Tests 3/4 (push) Has been cancelled
Some checks failed
Commit Message Check / Check Commit Message (push) Has been cancelled
CI / Code Linter (push) Has been cancelled
CI / Common Tests (push) Has been cancelled
CI / Frontend Tests (push) Has been cancelled
CI / Render WASM Tests (push) Has been cancelled
CI / Backend Tests (push) Has been cancelled
CI / Library Tests (push) Has been cancelled
CI / Build Integration Bundle (push) Has been cancelled
CI / Integration Tests 1/4 (push) Has been cancelled
CI / Integration Tests 2/4 (push) Has been cancelled
CI / Integration Tests 3/4 (push) Has been cancelled
This commit is contained in:
committed by
Belén Albeza
parent
8840246425
commit
63959a22cc
@@ -475,9 +475,9 @@
|
||||
(dissoc :style)
|
||||
(merge style)
|
||||
(select-keys allowed-keys))
|
||||
fill-rule (or (-> attrs :fill-rule sr/translate-fill-rule) (-> attrs :fillRule sr/translate-fill-rule))
|
||||
stroke-linecap (or (-> attrs :stroke-linecap sr/translate-stroke-linecap) (-> attrs :strokeLinecap sr/translate-stroke-linecap))
|
||||
stroke-linejoin (or (-> attrs :stroke-linejoin sr/translate-stroke-linejoin) (-> attrs :strokeLinejoin sr/translate-stroke-linejoin))
|
||||
fill-rule (-> (or (:fill-rule attrs) (:fillRule attrs)) sr/translate-fill-rule)
|
||||
stroke-linecap (-> (or (:stroke-linecap attrs) (:strokeLinecap attrs)) sr/translate-stroke-linecap)
|
||||
stroke-linejoin (-> (or (:stroke-linejoin attrs) (:strokeLinejoin attrs)) sr/translate-stroke-linejoin)
|
||||
fill-none (= "none" (-> attrs :fill))]
|
||||
(h/call wasm/internal-module "_set_shape_svg_attrs" fill-rule stroke-linecap stroke-linejoin fill-none)))
|
||||
|
||||
|
||||
@@ -645,15 +645,13 @@ impl RenderState {
|
||||
if frame_has_blur && shape_has_blur {
|
||||
shape.to_mut().set_blur(None);
|
||||
}
|
||||
} else {
|
||||
if !frame_has_blur {
|
||||
} else if !frame_has_blur {
|
||||
if let Some(blur) = self.combined_layer_blur(shape.blur) {
|
||||
shape.to_mut().set_blur(Some(blur));
|
||||
}
|
||||
} else if shape_has_blur {
|
||||
shape.to_mut().set_blur(None);
|
||||
}
|
||||
}
|
||||
|
||||
let center = shape.center();
|
||||
let mut matrix = shape.transform;
|
||||
|
||||
@@ -908,7 +908,7 @@ impl Shape {
|
||||
|
||||
match (mask_rect, content_rect) {
|
||||
(Some(mut mask), Some(content)) => {
|
||||
if mask.intersect(&content) {
|
||||
if mask.intersect(content) {
|
||||
rect.join(mask);
|
||||
}
|
||||
}
|
||||
@@ -1527,20 +1527,27 @@ mod tests {
|
||||
let mask_id = Uuid::new_v4();
|
||||
let content_id = Uuid::new_v4();
|
||||
|
||||
{
|
||||
let group = pool.add_shape(group_id);
|
||||
group.set_shape_type(Type::Group(Group { masked: true }));
|
||||
group.children = vec![mask_id, content_id];
|
||||
}
|
||||
|
||||
{
|
||||
let mask = pool.add_shape(mask_id);
|
||||
mask.set_shape_type(Type::Rect(Rect::default()));
|
||||
mask.set_selrect(0.0, 0.0, 50.0, 50.0);
|
||||
mask.set_parent(group_id);
|
||||
}
|
||||
|
||||
{
|
||||
let content = pool.add_shape(content_id);
|
||||
content.set_shape_type(Type::Rect(Rect::default()));
|
||||
content.set_selrect(-10.0, -10.0, 110.0, 110.0);
|
||||
content.set_parent(group_id);
|
||||
}
|
||||
|
||||
let group = pool.get(&group_id).expect("group should exist");
|
||||
let extrect = group.calculate_extrect(&pool, 1.0);
|
||||
|
||||
assert_eq!(extrect.left, 0.0);
|
||||
|
||||
Reference in New Issue
Block a user