PixelPaint: Remove unused function definition from Image
This was accidentally added in #18028.
Neither will allow you to create a layer with no name.
Sure, sounds like a different issue though :^) this is about just pressing return in the new layer dialog and ending up with the wrong layer name.
No, don't close it :( I will work on this tonight!
You're implying that this PR still isn't done, I'll label it as such.
Previously, if you confirmed the "new layer" dialog without any change to the layer name, the layer would end up with an empty string for its name.
PixelPaint: Include possible errno description in error messages
In the case where an error is created from an errno, calling string_literal() will print nothing. Using Error's formatter instead gives a more descriptive error message.
PixelPaint: Use new String to format error messages
In the case where an error is created from an errno, calling string_literal()
will print nothing. Using Error's formatter instead gives a more descriptive error message.
Before:
After:
PixelPaint: Add a Duplicate Layer action
The "Duplicate Layer" action inserts a copy of the selected layer into the layer stack. The new layer is placed above the selected layer.
The "Duplicate Layer" action inserts a copy of the selected layer into the layer stack. The new layer is placed above the selected layer.
The new layer is named "(original layer name) copy" with additional copies being sequentially numbered. This matches the behavior of Photoshop.
I chose Ctrl+Shift+D as the shortcut for this feature. This combination matches GIMP and fits in with other layer copying functions we already have.
Video:
https://user-images.githubusercontent.com/2817754/227605103-17b32837-79a2-410a-8bd5-9e7ab5605951.mp4
I'm wondering why we even allow selecting outside of the image/content bounds? It's fine to move the tool there, but the actual selected pixels should stay within the content bounds in my opinion.
This solves your excessive memory usage issue as well as the differences to other paint programs that we have. Ideally, drawing a lasso selection is a simple path that we track, and upon release of the mouse we select all pixels within the content bounds.
PixelPaint: Make wand tool work when layer and image rects differ
Previously, the position of the mask used to calculate the new selection did not match the position of the active layer. The program would crash when trying to set a mask pixel outside the bounds of the active layer.
Previously, the position of the mask used to calculate the new selection did not match the position of the active layer. The program would crash when trying to set a mask pixel outside the bounds of the active layer.
Minimal steps required to reproduce the issue on master
:
https://user-images.githubusercontent.com/3210731/227746872-c68a7591-e2b4-457e-8585-836ddd938e3c.mp4