From e71d569cda0727ed017b128bdab25420c4e1e60b Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Wed, 25 Jan 2023 16:01:24 +0100 Subject: [PATCH] :bug: Fix ctrl+c on inspect code --- CHANGES.md | 6 ++---- frontend/src/app/main/data/workspace.cljs | 24 ++++++++++++++--------- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index d21e5db7d..9d1fe5deb 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -56,18 +56,16 @@ - Fix undo ungroup (shift+g) scrambles positions [Taiga #4674](https://tree.taiga.io/project/penpot/issue/4674) - Fix justified text is stretched [Github #2539](https://github.com/penpot/penpot/issues/2539) - Fix mousewheel on viewer inspector [Taiga #4221](https://tree.taiga.io/project/penpot/issue/4221) -<<<<<<< HEAD - Fix path edition activated on boards [Taiga #4105](https://tree.taiga.io/project/penpot/issue/4105) - Fix hidden layers inside groups become visible after the group visibility is changed[Taiga #4710](https://tree.taiga.io/project/penpot/issue/4710) - Fix format of HSLA color on viewer [Taiga #4393](https://tree.taiga.io/project/penpot/issue/4393) - Fix some typos [Taiga #4724](https://tree.taiga.io/project/penpot/issue/4724) +- Fix ctrl+c for inspect code [Taiga #4739](https://tree.taiga.io/project/penpot/issue/4739) +- Fix text in custom font is not at the expected position at export [Taiga #4394](https://tree.taiga.io/project/penpot/issue/4394) ### :heart: Community contributions by (Thank you!) - To @iprithvitharun: let's make UX Writing contributions in Open Source a trend! -======= -- Fix text in custom font is not at the expected position at export [Taiga #4394](https://tree.taiga.io/project/penpot/issue/4394) ->>>>>>> 1a9c62848 (:bug: Fix font vertical metrics) ## 1.16.2-beta diff --git a/frontend/src/app/main/data/workspace.cljs b/frontend/src/app/main/data/workspace.cljs index b1e36b369..a6cc23087 100644 --- a/frontend/src/app/main/data/workspace.cljs +++ b/frontend/src/app/main/data/workspace.cljs @@ -1311,16 +1311,22 @@ :file-id (:current-file-id state) :selected selected :objects {} - :images #{}}] + :images #{}} + selected_text (.. js/window getSelection toString)] - (->> (rx/from (seq (vals pdata))) - (rx/merge-map (partial prepare-object objects selected+children)) - (rx/reduce collect-data initial) - (rx/map (partial sort-selected state)) - (rx/map t/encode-str) - (rx/map wapi/write-to-clipboard) - (rx/catch on-copy-error) - (rx/ignore))))))) + (if (not-empty selected_text) + (try + (wapi/write-to-clipboard selected_text) + (catch :default e + (on-copy-error e))) + (->> (rx/from (seq (vals pdata))) + (rx/merge-map (partial prepare-object objects selected+children)) + (rx/reduce collect-data initial) + (rx/map (partial sort-selected state)) + (rx/map t/encode-str) + (rx/map wapi/write-to-clipboard) + (rx/catch on-copy-error) + (rx/ignore)))))))) (declare paste-shape) (declare paste-text)