mirror of
https://github.com/penpot/penpot.git
synced 2025-01-24 07:29:08 -05:00
commit
83c8e7f03a
9 changed files with 49 additions and 36 deletions
|
@ -25,8 +25,11 @@
|
|||
- Fix style for team invite in deutsch [Taiga #4614](https://tree.taiga.io/project/penpot/issue/4614)
|
||||
- Fix problem with text edition in Safari [Taiga #4046](https://tree.taiga.io/project/penpot/issue/4046)
|
||||
- Fix show outline with rounded corners on rects [Taiga #4053](https://tree.taiga.io/project/penpot/issue/4053)
|
||||
- Fix wrong interaction between comments and panning modes [Taiga #4297](https://tree.taiga.io/project/penpot/issue/4297)
|
||||
- Fix bad element positioning on interaction with fixed scroll [Github #2660](https://github.com/penpot/penpot/issues/2660)
|
||||
- Fix display type of component library not persistent [Taiga #4512](https://tree.taiga.io/project/penpot/issue/4512)
|
||||
- Fix problem when moving texts with keyboard [#2690](https://github.com/penpot/penpot/issues/2690)
|
||||
- Fix problem when drawing boxes won't detect mouse-up [Taiga #4618](https://tree.taiga.io/project/penpot/issue/4618)
|
||||
|
||||
### :arrow_up: Deps updates
|
||||
|
||||
|
|
|
@ -38,6 +38,10 @@
|
|||
(->> stream
|
||||
(rx/filter ms/mouse-click?)
|
||||
(rx/switch-map #(rx/take 1 ms/mouse-position))
|
||||
(rx/with-latest-from ms/keyboard-space)
|
||||
(rx/tap prn)
|
||||
(rx/filter (fn [[_ space]] (not space)) )
|
||||
(rx/map first)
|
||||
(rx/map handle-comment-layer-click)
|
||||
(rx/take-until stoper))
|
||||
(->> stream
|
||||
|
|
|
@ -94,19 +94,22 @@
|
|||
(rx/of #(assoc-in state [:workspace-drawing :object] shape))
|
||||
|
||||
;; Initial SNAP
|
||||
(->> (snap/closest-snap-point page-id [shape] objects layout zoom focus initial)
|
||||
(rx/map move-drawing))
|
||||
(->>
|
||||
(rx/concat
|
||||
(->> (snap/closest-snap-point page-id [shape] objects layout zoom focus initial)
|
||||
(rx/map move-drawing))
|
||||
|
||||
(->> ms/mouse-position
|
||||
(rx/filter #(> (gpt/distance % initial) (/ 2 zoom)))
|
||||
(rx/with-latest vector ms/mouse-position-shift)
|
||||
(rx/switch-map
|
||||
(fn [[point :as current]]
|
||||
(->> (snap/closest-snap-point page-id [shape] objects layout zoom focus point)
|
||||
(rx/map #(conj current %)))))
|
||||
(rx/map
|
||||
(fn [[_ shift? point]]
|
||||
#(update-drawing % initial (cond-> point snap-pixel? gpt/round) shift?)))
|
||||
(->> ms/mouse-position
|
||||
(rx/filter #(> (gpt/distance % initial) (/ 2 zoom)))
|
||||
(rx/with-latest vector ms/mouse-position-shift)
|
||||
(rx/switch-map
|
||||
(fn [[point :as current]]
|
||||
(->> (snap/closest-snap-point page-id [shape] objects layout zoom focus point)
|
||||
(rx/map #(conj current %)))))
|
||||
(rx/map
|
||||
(fn [[_ shift? point]]
|
||||
#(update-drawing % initial (cond-> point snap-pixel? gpt/round) shift?)))))
|
||||
(rx/take-until stoper))
|
||||
|
||||
(rx/take-until stoper))
|
||||
(rx/of (common/handle-finish-drawing)))))))
|
||||
(->> (rx/of (common/handle-finish-drawing))
|
||||
(rx/delay 100)))))))
|
||||
|
|
|
@ -104,11 +104,17 @@
|
|||
:on-blur on-blur
|
||||
:on-focus on-focus
|
||||
:on-change on-change}]
|
||||
(when (or @show-buttons?
|
||||
(seq @content))
|
||||
(when (or @show-buttons? (seq @content))
|
||||
[:div.buttons
|
||||
[:input.btn-primary {:type "button" :value "Post" :on-click on-submit :disabled (str/empty-or-nil? @content)}]
|
||||
[:input.btn-secondary {:type "button" :value "Cancel" :on-click on-cancel}]])]))
|
||||
[:input.btn-primary
|
||||
{:type "button"
|
||||
:value "Post"
|
||||
:on-click on-submit
|
||||
:disabled (str/empty-or-nil? @content)}]
|
||||
[:input.btn-secondary
|
||||
{:type "button"
|
||||
:value "Cancel"
|
||||
:on-click on-cancel}]])]))
|
||||
|
||||
(mf/defc draft-thread
|
||||
[{:keys [draft zoom on-cancel on-submit position-modifier]}]
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
(mf/defc frame-clip-def
|
||||
[{:keys [shape render-id]}]
|
||||
(when (= :frame (:type shape))
|
||||
(when (and (= :frame (:type shape)) (not (:show-content shape)))
|
||||
(let [{:keys [x y width height]} shape
|
||||
transform (gsh/transform-str shape)
|
||||
props (-> (attrs/extract-style-attrs shape)
|
||||
|
@ -66,8 +66,7 @@
|
|||
|
||||
[:*
|
||||
[:g {:clip-path (when (not show-content) (frame-clip-url shape render-id))}
|
||||
(when (not show-content)
|
||||
[:& frame-clip-def {:shape shape :render-id render-id}])
|
||||
[:& frame-clip-def {:shape shape :render-id render-id}]
|
||||
|
||||
[:& shape-fills {:shape shape}
|
||||
(if path?
|
||||
|
|
|
@ -146,5 +146,5 @@
|
|||
[:g.frame-thumbnail-wrapper
|
||||
{:id (dm/str "thumbnail-container-" (:id shape))
|
||||
;; Hide the thumbnail when not displaying
|
||||
:opacity (when (and @rendered? (not thumbnail?) (not render-frame?)) 0)}
|
||||
:opacity (when-not thumbnail? 0)}
|
||||
thumbnail-renderer]]])))))
|
||||
|
|
|
@ -224,10 +224,9 @@
|
|||
(mf/use-effect
|
||||
(mf/deps add-children)
|
||||
(fn []
|
||||
(doseq [{:keys [frame shape]} add-children-prev]
|
||||
(let [frame-node (get-shape-node node frame)
|
||||
shape-node (get-shape-node shape)
|
||||
mirror-node (dom/query frame-node (dm/fmt ".mirror-shape[href='#shape-%'" shape))]
|
||||
(doseq [{:keys [shape]} add-children-prev]
|
||||
(let [shape-node (get-shape-node shape)
|
||||
mirror-node (dom/query (dm/fmt ".mirror-shape[href='#shape-%'" shape))]
|
||||
(when mirror-node (.remove mirror-node))
|
||||
(dom/remove-attribute! (dom/get-parent shape-node) "display")))
|
||||
|
||||
|
@ -235,6 +234,9 @@
|
|||
(let [frame-node (get-shape-node frame)
|
||||
shape-node (get-shape-node shape)
|
||||
|
||||
clip-id
|
||||
(dom/get-attribute (dom/query frame-node ":scope > defs > .frame-clip-def") "id")
|
||||
|
||||
use-node
|
||||
(.createElementNS globals/document "http://www.w3.org/2000/svg" "use")
|
||||
|
||||
|
@ -242,6 +244,7 @@
|
|||
(or (dom/query frame-node ".frame-children") frame-node)]
|
||||
|
||||
(dom/set-attribute! use-node "href" (dm/fmt "#shape-%" shape))
|
||||
(dom/set-attribute! use-node "clip-path" (dm/fmt "url(#%)" clip-id))
|
||||
(dom/add-class! use-node "mirror-shape")
|
||||
(dom/append-child! contents-node use-node)
|
||||
(dom/set-attribute! (dom/get-parent shape-node) "display" "none")))))
|
||||
|
|
|
@ -167,6 +167,10 @@
|
|||
(or (and (not remote?)
|
||||
(not (text-properties-equal? old-shape new-shape)))
|
||||
|
||||
(and (not= new-modifiers old-modifiers)
|
||||
(or (ctm/empty? new-modifiers)
|
||||
(ctm/empty? old-modifiers)))
|
||||
|
||||
(and (not= new-modifiers old-modifiers)
|
||||
(or (not (ctm/only-move? new-modifiers))
|
||||
(not (ctm/only-move? old-modifiers))))
|
||||
|
|
|
@ -56,7 +56,7 @@
|
|||
middle-click? (and (not panning) (= 2 (.-which event)))]
|
||||
|
||||
(cond
|
||||
middle-click?
|
||||
(or middle-click? (and left-click? @space?))
|
||||
(do
|
||||
(dom/prevent-default bevent)
|
||||
(if mod?
|
||||
|
@ -85,15 +85,6 @@
|
|||
(when-not workspace-read-only?
|
||||
(st/emit! (dwdp/handle-area-selection shift?)))
|
||||
|
||||
(and @space? mod?)
|
||||
(let [raw-pt (dom/get-client-position event)
|
||||
viewport (mf/ref-val viewport-ref)
|
||||
pt (utils/translate-point-to-viewport viewport zoom raw-pt)]
|
||||
(st/emit! (dw/start-zooming pt)))
|
||||
|
||||
@space?
|
||||
(st/emit! (dw/start-panning))
|
||||
|
||||
drawing-tool
|
||||
(when-not workspace-read-only?
|
||||
(st/emit! (dd/start-drawing drawing-tool)))
|
||||
|
|
Loading…
Add table
Reference in a new issue