Skip to content

Commit 5d34887

Browse files
committed
Improvement - PenAndPaper - Add background and set user select none on text nodes
1 parent 6ea6cb0 commit 5d34887

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,4 +105,4 @@
105105
"vitest": "^3.1.1",
106106
"vue": "^3.5.14"
107107
}
108-
}
108+
}

src/atoms/NonSvgPenAndPaper.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ function startSvgTextEditing(event) {
8989
tspan.textContent = '';
9090
textNode.appendChild(tspan);
9191
textNode.style.pointerEvents = 'none';
92+
textNode.style.userSelect = 'none';
9293
9394
G.value.appendChild(textNode);
9495
editingTextNode.value = textNode;
@@ -540,6 +541,7 @@ const range = ref(null);
540541
'vue-ui-pen-and-paper-actions': true,
541542
'visible': active
542543
}"
544+
:style="{ backgroundColor: backgroundColor }"
543545
>
544546
<button
545547
class="vue-ui-pen-and-paper-action"

src/atoms/PenAndPaper.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ function startSvgTextEditing(event) {
7474
tspan.textContent = '';
7575
textNode.appendChild(tspan);
7676
textNode.style.pointerEvents = 'none';
77+
textNode.style.userSelect = 'none';
7778
7879
G.value.appendChild(textNode);
7980
editingTextNode.value = textNode;
@@ -579,7 +580,7 @@ onBeforeUnmount(() => {
579580
</script>
580581
581582
<template>
582-
<div v-if="active" data-dom-to-png-ignore class="vue-ui-pen-and-paper-actions">
583+
<div v-if="active" data-dom-to-png-ignore class="vue-ui-pen-and-paper-actions" :style="{ backgroundColor: backgroundColor }">
583584
<button class="vue-ui-pen-and-paper-action" @click="emit('close')" :style="{
584585
backgroundColor: backgroundColor,
585586
border: `1px solid ${buttonBorderColor}`

0 commit comments

Comments
 (0)