ImageGlass icon indicating copy to clipboard operation
ImageGlass copied to clipboard

Zooming using the mouse wheel on a SVG file with Webview2 doesn't work

Open Tomoko1 opened this issue 1 year ago β€’ 17 comments

System information:

  • Windows OS version: Microsoft Windows NT 10.0.19045.0 64-bit
  • ImageGlass version: 9.0.8.1208 (64-bit)

To Reproduce

Steps to reproduce the behavior:

  1. Open a SVG file with the setting "Use Webview2 for viewing SVG format" enabled
  2. Attempt to zoom in and out with the mouse wheel

Actual behavior:

I can zoom in or out once on an image but trying to zoom in or out more than that makes the image disappear. Afterwards, making the image reappear is impossible. When zooming in and out, the title bar also shows weird zoom values. Zooming in or out by clicking on the buttons in the toolbar works as expected, but the title bar also shows weird zoom values. (e.g. after zooming out on an image, the title bar shows a zoom value of "731.139.086.026.276.864%")

Expected behavior:

Zooming in and out should work as expected.

Screenshots:

After zooming in with the mouse wheel once zoomin After zooming in with the mouse wheel twice zoomin2

Additional context:

I have "Use smooth zooming" enabled, but a similar bug happens with this setting disabled too.

Tomoko1 avatar Dec 08 '23 16:12 Tomoko1

Hi @Tomoko1 Can you help me check if there are any error in WebView2. You can follow these steps:

  • Open igconfig.json in text editor
  • Close all IG 9 instances
  • Set EnableDebug to true, and save the igconfig.json file
  • Run IG 9 again, press Ctrl+Shift+I to open WebView2 DevTool
  • Go to "Console" tab of DevTool, capture it

image

d2phap avatar Dec 12 '23 11:12 d2phap

Hello. Here's a screen of the console (I zoomed in twice with the mouse wheel and then tried to zoom out once) zoom1 Here's also a screen of the console when I zoom out with the buttons in the toolbar. zoom2

Tomoko1 avatar Dec 12 '23 22:12 Tomoko1

I have the exact same issue. IG 9.0.9.1230 on Win 11. Checking to use Webview2 or not does not make a difference.

VOOM108 avatar Jan 02 '24 23:01 VOOM108

Same issue for long timeπŸ«₯

DanRotaru avatar Jan 10 '24 12:01 DanRotaru

Still an issue in 9.0.10.201 (64-bit). "Actual size" and "Scale to fit" work, but any manual zoom-in instantly sets it to 10000% zoom. Then, depending on if 'smooth zoom' is on or not, it either only goes between 10000% and 0% (according to the titlebar, actual zoom is closer to 8k?, most definetly not 0%), or with smooth zoom off it goes 10000% -> 8000% -> 6000% -> 4500% -> 0%.

Turning off webview2 and restarting imageglass makes svgs function as a normal rasterized image

image Top to bottom it's setting mode to actual size, setting mode to scale to fit, zoom in, then zoom out four times, after which no more zoom out is processed

Koushakur avatar Feb 20 '24 14:02 Koushakur

I conducted a small investigation. When I export a file with the 'Set Viewbox' option from Affinity Designer, I can't zoom in using ImageGlass, but the size always remains at 100%.

When I export the file without this option, the zoom increases to 10000%. I also checked on two other computers where I have ImageGlass, and the effect is the same.

image

triget avatar Jun 13 '24 07:06 triget

I believe this issue should be treated as a priority because the inability to zoom SVGs eliminates the possibility of using ImageGlass in daily work. In the old version (version 8), there were no such problems. I'm surprised that nothing has been done about this since December 2023.

triget avatar Jun 28 '24 09:06 triget

@triget Can you send your sample SVG file?

You can uncheck this setting to switch to the native SVG renderer (same as v8). This is still on my priority list, but also depends on whether I can reproduce the issue, the difficulty, and my time.

image

d2phap avatar Jun 28 '24 10:06 d2phap

@d2phap I packed the SVG into a .zip file to make it easier to download from GitHub.

Btw. Thank you for the suggestion to switch to native SVG viewing. Now the zoom works.

test.zip

Unfortunately, there are now issues with some elements. Look at how the letter S appears compared to the T next to it.

problem

triget avatar Jun 29 '24 17:06 triget

Unfortunately, there are now issues with some elements. Look at how the letter S appears compared to the T next to it.

The native renderer is same as v8, it does not support scaling.

I tried opening your SVG file with v9.1.7.627, it works fine:

https://github.com/d2phap/ImageGlass/assets/3154213/f7260038-cacf-486a-a14c-80d9b1c01a1c

d2phap avatar Jun 29 '24 18:06 d2phap

@triget Can you help me download & test this build?

It contains logging function to create a log file __ig_web2_log.log when the app closed. Please follow these scenarios:

Scenario 1: Mouse Scroll Down (Slow)

  1. Open your SVG file with ImageGlass
  2. Scroll down your mouse 3 times (or 3 scrolls)
  3. Close the app, go to IG_SVG_Debug and copy the log file, attach here

Scenario 2: Mouse Scroll Up (Slow)

  1. Open your SVG file with ImageGlass
  2. Scroll up your mouse 3 times (or 3 scrolls)
  3. Close the app, go to IG_SVG_Debug and copy the log file, attach here

Scenario 3: Mouse Scroll Down (Fast)

  1. Open your SVG file with ImageGlass
  2. Make long Scroll down your mouse multiple times
  3. Close the app, go to IG_SVG_Debug and copy the log file, attach here

Scenario 4: Mouse Scroll Up (Fast)

  1. Open your SVG file with ImageGlass
  2. Make long Scroll up your mouse multiple times
  3. Close the app, go to IG_SVG_Debug and copy the log file, attach here

Scenario 5: Mouse Scroll Down + Up

  1. Open your SVG file with ImageGlass
  2. Scroll your mouse in any direction multiple times
  3. Close the app, go to IG_SVG_Debug and copy the log file, attach here

Scenario 6: Use Trackpad

  1. Open your SVG file with ImageGlass
  2. Slowly move 2 fingers down on the trackpad
  3. Slowly move 2 fingers up on the trackpad
  4. Close the app, go to IG_SVG_Debug and copy the log file, attach here

After finishing all the scenarios, you should attach here 6 log files. Thank you!

d2phap avatar Jun 29 '24 21:06 d2phap

@d2phap

I have executed scenarios 1-5. I do not have a trackpad (I think this is not a problem). In the scenario where I have to zoom the file, I can only do it once. After zooming in on the file, it immediately reaches 10000% magnification and nothing else can be done. I am attaching a .zip file with logs. If you need anything else, just let me know. I am happy to test/help.

scenario.zip

I have attached a video recorded on your test build @d2phap

https://github.com/d2phap/ImageGlass/assets/9076850/2759e745-599c-4185-869b-547b12cf0b0e

If it helps, I am open to scheduling a session on TeamViewer or a similar tool, and you can test things out yourself to see how everything works :)

triget avatar Jun 30 '24 08:06 triget

@triget Thanks a lot! I have been on a trip so I will try to check & get back to you when I have time.

d2phap avatar Jun 30 '24 21:06 d2phap

OK, I managed to reproduce it. This issue happens when your Decimal symbol is not .

image

d2phap avatar Jun 30 '24 22:06 d2phap

@d2phap Can you manage to fix this? Not everywhere can the decimal symbol be used as a dot.

triget avatar Jul 01 '24 06:07 triget

@triget It should be fixed in this build: https://drive.google.com/file/d/1e5y97jKVM7QWR2q5Py1-WsgOEzE93T18/view?usp=sharing

d2phap avatar Jul 01 '24 06:07 d2phap

I can confirm that the issue has been fixed for me in that build πŸ˜‡πŸ’–

Tomoko1 avatar Jul 02 '24 15:07 Tomoko1

Fixed in ImageGlass 9.1.8.723

d2phap avatar Jul 22 '24 09:07 d2phap