mirror of
https://github.com/penpot/penpot.git
synced 2025-02-26 16:56:11 -05:00
Return to previous path drawing method.
This commit is contained in:
parent
ee9b99635b
commit
13e8679713
3 changed files with 12 additions and 13 deletions
|
@ -43,5 +43,5 @@
|
|||
attrs (-> (attrs/extract-style-attrs shape)
|
||||
(merge {:id key :key key :d (render-path shape)})
|
||||
(merge (when-not drawing?
|
||||
{:transform (str rfm)})))]
|
||||
#_{:transform (str rfm)})))]
|
||||
[:path attrs]))
|
||||
|
|
|
@ -133,18 +133,18 @@
|
|||
maxx (apply max (map :x points))
|
||||
maxy (apply max (map :y points))
|
||||
|
||||
dx (- 0 minx)
|
||||
dy (- 0 miny)
|
||||
points (mapv #(gpt/add % [dx dy]) points)
|
||||
;; dx (- 0 minx)
|
||||
;; dy (- 0 miny)
|
||||
;; points (mapv #(gpt/add % [dx dy]) points)
|
||||
width (- maxx minx)
|
||||
height (- maxy miny)]
|
||||
|
||||
(assoc shape
|
||||
:x1 minx
|
||||
:y1 miny
|
||||
:x2 maxx
|
||||
:y2 maxy
|
||||
:view-box [0 0 width height]
|
||||
;; :x1 minx
|
||||
;; :y1 miny
|
||||
;; :x2 maxx
|
||||
;; :y2 maxy
|
||||
;; :view-box [0 0 width height]
|
||||
:points points)))
|
||||
|
||||
(on-first-point [point]
|
||||
|
@ -193,10 +193,10 @@
|
|||
maxx (apply max (map :x points))
|
||||
maxy (apply max (map :y points))
|
||||
|
||||
dx (- 0 minx)
|
||||
dy (- 0 miny)
|
||||
;; dx (- 0 minx)
|
||||
;; dy (- 0 miny)
|
||||
;; _ (println "Initial number of points:" (count points))
|
||||
points (mapv #(gpt/add % [dx dy]) points)
|
||||
;; points (mapv #(gpt/add % [dx dy]) points)
|
||||
points (path/simplify points 0.1)
|
||||
;; _ (println "Final number of points:" (count points))
|
||||
width (- maxx minx)
|
||||
|
|
|
@ -159,7 +159,6 @@
|
|||
(Point. (mth/precision x decimanls)
|
||||
(mth/precision y decimanls)))
|
||||
|
||||
|
||||
(defn transform
|
||||
"Transform a point applying a matrix transfomation."
|
||||
[{:keys [x y] :as p} {:keys [a b c d tx ty] :as m}]
|
||||
|
|
Loading…
Add table
Reference in a new issue