zsviczian / obsidian-excalidraw-plugin

A plugin to edit and view Excalidraw drawings in Obsidian
3.68k stars 202 forks source link

BUG: Pasted images don't embed correctly when resized #1761

Open declanoller opened 1 month ago

declanoller commented 1 month ago

Your environment

SYSTEM INFO:
    Obsidian version: v1.5.12
    Installer version: v1.5.12
    Operating system: #31-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 20 00:40:06 UTC 2024 6.8.0-31-generic
    Login status: not logged in
    Insider build toggle: off
    Live preview: on
    Base theme: dark
    Community theme: Obsidian Nord v0.2.0
    Snippets enabled: 0
    Restricted mode: off
    Plugins installed: 8
    Plugins enabled: 8
        1: Git v2.24.1
        2: Copy Block Link v1.0.4
        3: Dataview v0.5.66
        4: Advanced Tables v0.21.0
        5: Extended MathJax v0.4.1
        6: Mousewheel Image zoom v1.0.22
        7: Checklist Reset v1.2.1
        8: Excalidraw v2.1.7

RECOMMENDATIONS:
    Custom theme and snippets: for cosmetic issues, please first try updating your theme and disabling your snippets. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community theme and snippets.
    Community plugins: for bugs, please first try updating all your plugins to latest. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community plugins.

Describe the bug If you paste an image from the clipboard in, then hold the Shift key to resize it in a single dimension, like stretch it vertically, it works as expected in Excalidraw. But when you embed it into a note with ![[my_drawing.excalidraw]], it shows an incorrect version in the embedding.

To Reproduce Steps to reproduce the behavior:

  1. Copy some image, like a screenshot or anything
  2. Ctrl + V to paste into Excalidraw
  3. Click on pasted image, hold shift, resize vertical
  4. Embed image in Obsidian note with ![[ ... ]]

Expected behavior I expect that it should look like it does in Excalidraw, resized.

Screenshots Here it is in Excalidraw: image

You can see that the right one is a duplicate (duplicated using click + alt + drag) of the left one (the original pasted image), which was then stretched vertically.

Here it is embedded: image

Additional context n/a