Skip to content

Commit

Permalink
Move skip cells while moving frames
Browse files Browse the repository at this point in the history
  • Loading branch information
prabhanshuguptagit committed Aug 22, 2024
1 parent c9f0bd9 commit 7da10d1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/bean/frames.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,18 @@
(get-in sheet [:frames frame-name :labels])
#(util/offset move-to (util/distance move-from %)))))

(defn- move-skip-cells [sheet frame-name move-from move-to]
(assoc-in
sheet [:frames frame-name :skip-cells]
(map
#(util/offset move-to (util/distance move-from %))
(get-in sheet [:frames frame-name :skip-cells]))))

(defn move-frame [sheet frame-name area]
(let [start (get-in sheet [:frames frame-name :start])]
(-> (update-in sheet [:frames frame-name] merge area)
(move-labels frame-name start (:start area))
(move-skip-cells frame-name start (:start area))
(remove-outside-labels frame-name))))

(defn expand-frames [sheet [updated-r updated-c]]
Expand Down

0 comments on commit 7da10d1

Please sign in to comment.