Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Selection tools turns existing image transparent #276

Open
AlexBella84 opened this issue Nov 10, 2023 · 6 comments
Open

Selection tools turns existing image transparent #276

AlexBella84 opened this issue Nov 10, 2023 · 6 comments
Labels
Milestone

Comments

@AlexBella84
Copy link

**Project erases after opening a file to edit. Using the select tool to which you can select/erase/cut/copy/duplicate, I can maybe do only one move (such as erasing area I select) but after that any type of choice I make using the select tool, the entire project erases and turns the backround grey. The initital project that I originally opened is now gone and I am unable to do anything more to the file I wanted to edit and continue working on.

  1. With a new page and clear screen, you select "Open" to choose a file to edit, work on.
  2. Once file is opened, I use the select tool to highlight an area to erase, but it wont erase selected area, it erases everything leaving the highlighted area just a white box.

Whats supposed to happen or what its always done for me for the last 2 years Ive been using PaintZ is whatever area I select it'll erase or edit JUST the highlighted area, not the entire page and erasing all other content.

Whats even crazier is that it first happened on my desktop at home, then later on my laptop which are 2 completely different devices. I have uninstalled the App, reinstalled and still had the same issue. Ive used it both online and what was dowhloaded to my device as is. So please help me figure this out anyway that you might have some ideas, I think Ive also cleared my cookies for the site as well. I feel there is somewhere a glitch, or a settings memory that got changed from the default settings maybe.
Thank You!!!
Screen P
Screen 2
Screen 3**

@ZMYaro ZMYaro changed the title Highlight tool erases ENTIRE project Erasing selection turns entire canvas transparent Nov 10, 2023
@ZMYaro ZMYaro changed the title Erasing selection turns entire canvas transparent Selection tools turns existing image transparent Nov 10, 2023
@ZMYaro
Copy link
Owner

ZMYaro commented Nov 10, 2023

Also reported by David Coover:

paintz_glitch.webm

@ZMYaro
Copy link
Owner

ZMYaro commented Nov 10, 2023

@AlexBella84 Thank you for reporting this issue.  I am still trying to figure out what might cause it since I have been unable to recreate it on any of my devices.  Since PaintZ 3.4.1 released at the end of last year, and this issue only started occurring, I want to make sure it isn't being caused by a Chrome update or something on your system.  May I ask whether you had any other apps or browser tabs open on your computer when this happened that could have consumed a lot of system resources?  Or have you had any graphical issues in other apps or webpages?

@ZMYaro
Copy link
Owner

ZMYaro commented Nov 10, 2023

Notes from my own (purely qualitative so far) testing:

  • Did reproduce in Chrome 119.0.6045.124 on Windows 10 and Windows 11.

  • Did reproduce in Edge 119.0.2151.44 (Chromium 119.0.6045.105) on Windows 11.

  • Did reproduce in Edge 119.0.2151.58 (Chromium 119.0.6045.123) on Windows 10 and Windows 11.

  • Could not reproduce in Chrome 118.0.5993.118 on Windows 11.

  • Could not reproduce in Firefox 119.0.1 on Windows 10 or Windows 11.

  • Reproducing the issue seems to require doing something that causes the selection cover to be drawn (erase the selection, drag it off its original position, resize it, or finalize it after having transformed it).

    • SelectionTool.prototype._drawSelectionStartCover
  • That generally needs to be done more than once for the issue to occur.

  • Sometimes refreshing the page makes the issue go away until after opening a new file.

  • Sometimes, if the issue isn't occurring, refreshing the page will make it occur.

  • Sometimes just waiting a bit makes it stop occurring.

  • It happens regardless of

    • Starting from a blank canvas or opening a file.
    • Opening a GIF, JPEG, or PNG.
    • Canvas size (i.e. not a large canvas memory issue).
    • Rectangular or freeform selection tool.
      • (Sometimes doesn't occur as consistently with the freeform selection tool.)
  • Since _drawSelectionStartCover only draws a rectangle, it could be an issue with SelectionTool.prototype._drawSelectionContent drawing the cover with the destination-over composite operation.

  • Drawing a shape with anti-aliasing disabled before using the selection tool seems to consistently prevent the issue occurring.

    • I tried that because those are the only other tools that use destination-over.
    • You can undo drawing the shape before proceeding. It seems to somehow ““fix””(?) the canvas.

@ZMYaro
Copy link
Owner

ZMYaro commented Nov 10, 2023

Update: Looking at recent Chrom* bugs, it appears the cause may have to do with the composite operation (crbug.com/1499539 (and maybe crbug.com/1500272)), or to do with using drawImage, getImageData, and/or putImageData between multiple canvases in Chrom* 119 (crbug.com/1500905).

Those tickets also point out using willReadFrequently solves the issue, but as one commenter points out, that doesn't necessarily make sense to do (e.g, in PaintZ, it doesn't make sense to turn off hardware acceleration all the time for the rare case someone may make a lot of rapid selections). However I am going to try it and maybe push it to Paintβ as a temporary fix.

@ZMYaro
Copy link
Owner

ZMYaro commented Nov 11, 2023

The willReadFrequently fix appears to work as expected, and was confirmed to work by @AlexBella84. It is up on Paintβ until Google fixes the Chrom* bug, and I posted about it across PaintZ socials.

I am going to keep this ticket open for now so people find it if they look for it, and then close it once Google fixes the bug.

@ZMYaro ZMYaro added this to the v3.5 milestone Nov 11, 2023
@ZMYaro
Copy link
Owner

ZMYaro commented Dec 14, 2023

Chrome 120 has released on the stable channel, and the issue seems to be fixed there on the one device I have tested so far. Going to hopefully test on other devices within the next week and be able to close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants