If you are zoomed out to 1-2% sometimes 4% and draw in bitmap mode over and around the canvas, the program hangs.
Crash while drawing bitmap
Open Pencil2D c0.6.4 on PC, Windows 10.
Zoom out with mouse wheel to 1%
Draw with Wacom Pencil or PC mouse on and around canvas
Program hangs.
Pencil2D Version:
v0.6.4
Operating System:
Windows 10 Pro
RAM Size:
16 GB
Graphics Tablet:
Wacom Intuos
This is basically expected behavior. When you zoom the canvas out, you are drawing on a larger section of the canvas. More memory needs to be allocated for larger drawings. If you make a drawing large enough to exceed the amount of memory you have available, the program will crash.
You could argue that we shouldn't allow users to zoom out that far, however:
As an aside, please upgrade to v0.6.5. It has many important improvements over the version you are currently using.
@scribblemaniac Hmm I see the point of your argument but I'd argue this is a legitimate issue and we still should look for a solution either by limiting the lowest amount of scale factor or perhaps only rendering what the camera sees past a certain zoom % threshold, similar to the rendering technique called frustrum culling.
If you zoom out in Krita or Photoshop with a 10K pixel square image / canvas, you certainly will get lag, but won't get a crash.
However Pencil2D (Version 0.6.5 nightly build from november 24th) will hang regardless of the camera size if it goes below 5% and draw something by mistake, and it will crash if you do something esle again. I tested this just now and the program hanged. I left it alone and after It regained focus, drawing was unbearably slow even at default scale, which i'd consider this a nasty bug derivative of this core issue.
I'm sure there must be something that can be done to lessen the impact of this problem, so I ask this to be reopened to track potential solutions at least at a ux enhancement level, and i'll open a new ticket for the other problem I mentioned related to this one.
There are things that can be done prevent this, only one of them are easy to apply as of currently... disable prescaling of the image.
The application crashes currently because you try to allocate a reasonably sized image and then downscale it while making copies of the said image to avoid modifying the painted image. This is slow, especially because QImage::copy() operation is considered VERY slow and we call it x times a second, to try to downscale the image.
The quickest fix for this in the current master branch is removing the CanvasPainter::prescale function. The better fix is to get a proper brush engine that can handle it. The mypaint branch will lagg if you draw on a huge image, but only after drawing the stroke and you will get control of the cursor again within seconds usually. Not lagging at all is not an option, at least not while the program is single threaded.
@CandyFace I see. Thank you for the explanation! In that case I personally would ask for everyone's consideration on handling the "better " if not a better fix without a doubt then.
Certainly under similar circumstances most software will lag, but continue to function, so I feel it's unacceptable to have Pencil2D hanging unresponsive and crashing because the user zooms out, even by accident, so as long as this scenario is improved in order to help the user experience, it will be preferable to what we have. Definitely a welcome enhancement 馃檪
Considering your comment on the the MyPaint branch implementation, should we reopen this and link it to the PR directly so it closes automatically at that time? This would be only for tracking purposes of course. If not deemed necessary then i'll add the _never forget_ tag and move on.
Most helpful comment
There are things that can be done prevent this, only one of them are easy to apply as of currently... disable prescaling of the image.
The application crashes currently because you try to allocate a reasonably sized image and then downscale it while making copies of the said image to avoid modifying the painted image. This is slow, especially because QImage::copy() operation is considered VERY slow and we call it x times a second, to try to downscale the image.
The quickest fix for this in the current master branch is removing the CanvasPainter::prescale function. The better fix is to get a proper brush engine that can handle it. The mypaint branch will lagg if you draw on a huge image, but only after drawing the stroke and you will get control of the cursor again within seconds usually. Not lagging at all is not an option, at least not while the program is single threaded.