nicojeske / mousewheel-image-zoom

An Obsidian plugin that enables you to increase/decrease the size of an image by holding down a configurable key (defaults to left alt), hovering over an image in preview mode and scrolling.
MIT License
90 stars 5 forks source link

Failed in canvas #37

Closed dongzhonghua closed 7 months ago

dongzhonghua commented 9 months ago

obsidian version: v1.5.3 platform: mac

failed on canvas file

nicojeske commented 8 months ago

This is currently not supported and I currently do not have the resources to implement it. I will leave the issue open in the case someone wants to work on it.

Mideks commented 8 months ago

@nicojeske I seem to have misunderstood the nature of these problems..... I just realised that I may have been referring to the canvas embedded md files, where you can't resize the picture while on the canvas.

But I originally understood this problem as "there are pictures on the canvas and you can't resize them with the wheel like in md files" Lol, and, I almost implemented that feature before I realised it might not be exactly what was meant.

Do you think my implementation is appropriate in your plugin?

nicojeske commented 8 months ago

I am also not sure what behaviour @dongzhonghua means. But currently both, zooming a directly embedded image in a canvas and zooming an image embedded in an md file that is embedded in the canvas, are not implemented.

Feel free to work on any of those two features if you want to, I will gladly merge your PR if you find a way to implement this.

Mideks commented 8 months ago

@nicojeske In fact, I've been working on this feature for two days now, and I think I've managed to finish it by 70%. I've found a way to directly resize the nodes on the canvas, and I'm testing the work now and finalising the scaling logic while preserving the proportions...

By the way, do you think resizing should only work for pictures, or for any type of node, like videos, sounds, pdf, texts or even md files?

Mideks commented 8 months ago

By the way, I opened #47 for the reason that it will not be possible to use Shift (because of horizontal scrolling) and Ctrl (because of canvas zooming) modifiers normally on canvas. So maybe it would be a good idea to enable scroll lock only when the cursor is over an element? (something like hover event)

nicojeske commented 7 months ago

Implemented as of #48 in 1.0.22