richrobber2 / canvas-zoom

zoom and pan functionality
350 stars 23 forks source link

Dragging in new image does not show, after going into full-screen mode #99

Closed fireattack closed 5 months ago

fireattack commented 8 months ago

This is not 100% reproducible but I can reproduce the bug 90% of the time after installing the extension.

Without extension, it still sometimes happens, but very very rare (like <5% of the time).

Steps to reproduce:

  1. Go img2img -> inpaint.
  2. Drag an image in.
  3. Press "S" to enter full-screen mode.
  4. Make some random masks on the canvas by dragging your cursor. (Optional; the bug can be trigger even without masking anything.)
  5. Press "S" again to exit full-screen mode.
  6. Now, without removing the current image, directly drag another image (preferably different size) into the canvas.

Expected: the new image is loaded and you can start work on it.

Observed: while the image is actually loaded and you can even draw and see its boundary, you cannot actually see the image itself:

image

A quick demo of the bug:

https://github.com/richrobber2/canvas-zoom/assets/4130991/128fe5c1-550a-48b7-959a-f924dd5e9e4b

richrobber2 commented 7 months ago

I've noticed this myself.

temp fix: would be to hit the undo button a few times it should be done anyways since the "lines" variable does not update when a new image is loaded. meaning it keeps the data from the last image. but that image no longer exists and when it updates to "the last image" then it would then be blank since the canvas works by layering multiple canvas' on top of each other and the temp one is on top

so instead of clicking the x button as you did in the video click the 2 to the left of it

@fireattack

richrobber2 commented 5 months ago

okay its not a temp fix i dont know how to solve this issue. its a state issue.

for now just hitting undo will bring it back

maybe we can detect when the image is not showing and then press undo when it happens but that could introduce other issues of loosing progress and i think that would not be good so i dont really think i can solve this one