mirror of
https://github.com/penpot/penpot.git
synced 2026-08-06 21:08:34 +00:00
✨ After review changes
This commit is contained in:
parent
f3b914534f
commit
de04026dc8
@ -259,10 +259,13 @@
|
|||||||
(api/update-shape-tiles)
|
(api/update-shape-tiles)
|
||||||
(api/request-render "set-wasm-attrs")))))
|
(api/request-render "set-wasm-attrs")))))
|
||||||
|
|
||||||
|
;; `conj` empty set initialization
|
||||||
|
(def conj* (fnil conj #{}))
|
||||||
|
|
||||||
(defn- impl-assoc
|
(defn- impl-assoc
|
||||||
[self k v]
|
[self k v]
|
||||||
(when shape/*shape-changes*
|
(when shape/*shape-changes*
|
||||||
(vswap! shape/*shape-changes* update (:id self) (fnil conj #{}) k))
|
(vswap! shape/*shape-changes* update (:id self) conj* k))
|
||||||
|
|
||||||
(case k
|
(case k
|
||||||
:id
|
:id
|
||||||
@ -284,13 +287,8 @@
|
|||||||
|
|
||||||
(defn- impl-dissoc
|
(defn- impl-dissoc
|
||||||
[self k]
|
[self k]
|
||||||
#_(when ^boolean shape/*wasm-sync*
|
|
||||||
(binding [shape/*wasm-sync* false]
|
|
||||||
(when (shape-in-current-page? (.-id ^ShapeProxy self))
|
|
||||||
(set-wasm-attrs! self k nil))))
|
|
||||||
|
|
||||||
(when shape/*shape-changes*
|
(when shape/*shape-changes*
|
||||||
(vswap! shape/*shape-changes* update (:id self) (fnil conj #{}) k))
|
(vswap! shape/*shape-changes* update (:id self) conj* k))
|
||||||
|
|
||||||
(case k
|
(case k
|
||||||
:id
|
:id
|
||||||
|
|||||||
@ -1151,7 +1151,7 @@ impl Shape {
|
|||||||
pub fn apply_transform(&mut self, transform: &Matrix) {
|
pub fn apply_transform(&mut self, transform: &Matrix) {
|
||||||
self.transform_selrect(transform);
|
self.transform_selrect(transform);
|
||||||
|
|
||||||
// We don't need to invalidate this? we can just transform it
|
// TODO: See if we can change this invalidation to a transformation
|
||||||
self.invalidate_extrect();
|
self.invalidate_extrect();
|
||||||
self.invalidate_bounds();
|
self.invalidate_bounds();
|
||||||
|
|
||||||
|
|||||||
@ -266,8 +266,6 @@ impl<'a> ShapesPoolImpl<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn set_modifiers(&mut self, modifiers: HashMap<Uuid, skia::Matrix>) {
|
pub fn set_modifiers(&mut self, modifiers: HashMap<Uuid, skia::Matrix>) {
|
||||||
// self.clean_shape_cache();
|
|
||||||
|
|
||||||
// Convert HashMap<Uuid, V> to HashMap<&'a Uuid, V> using references from shapes and
|
// Convert HashMap<Uuid, V> to HashMap<&'a Uuid, V> using references from shapes and
|
||||||
// Initialize the cache cells because later we don't want to have the mutable pointer
|
// Initialize the cache cells because later we don't want to have the mutable pointer
|
||||||
|
|
||||||
@ -394,25 +392,3 @@ impl<'a> ShapesPoolImpl<'a> {
|
|||||||
shape.is_bool()
|
shape.is_bool()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// fn is_modified_child(
|
|
||||||
// shape: &Shape,
|
|
||||||
// shapes: ShapesPoolRef,
|
|
||||||
// modifiers: &HashMap<Uuid, Matrix>,
|
|
||||||
// ) -> bool {
|
|
||||||
// if modifiers.is_empty() {
|
|
||||||
// return false;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// let ids = shape.all_children(shapes, true, false);
|
|
||||||
// let default = &Matrix::default();
|
|
||||||
// let parent_modifier = modifiers.get(&shape.id).unwrap_or(default);
|
|
||||||
//
|
|
||||||
// // Returns true if the transform of any child is different to the parent's
|
|
||||||
// ids.iter().any(|id| {
|
|
||||||
// !math::is_close_matrix(
|
|
||||||
// parent_modifier,
|
|
||||||
// modifiers.get(id).unwrap_or(&Matrix::default()),
|
|
||||||
// )
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user