Skip to content

Commit

Permalink
fix: handle negative values for textarea width/height
Browse files Browse the repository at this point in the history
  • Loading branch information
robertrosman committed Jun 9, 2024
1 parent 575c825 commit 6b40202
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/composables/tools/useTextarea/useTextarea.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,10 @@ export function useTextarea({

const ShapeSvgComponent = createShapeSvgComponent<Textarea>((textarea, { isActive }) =>
h('foreignObject', {
x: textarea.x,
y: textarea.y,
width: textarea.width,
height: textarea.height,
x: textarea.width > 0 ? textarea.x : textarea.x + textarea.width,
y: textarea.height > 0 ? textarea.y : textarea.y + textarea.height,
width: Math.abs(textarea.width),
height: Math.abs(textarea.height),
}, h('textarea', {
class: isActive ? 'is-active textarea' : 'textarea',
style: `font-size: ${textarea.fontSize}em; color: ${textarea.color}`,
Expand Down

0 comments on commit 6b40202

Please sign in to comment.