Use the correct color space to reset the cache in generator layer
This fixes the crash uncovered by b84ea913
It can be observed like this:
- Create a new document
- Add a new fill layer
- Switch to Gradient -- the application will crash
(For me the properties dialog starts in Color mode, and it crashes when I switch to Gradient).
Explanation:
If we get the color space from the paint device, it will return an incorrect value.
For example, it will be A/U8
instead of RGBA/U8
. Then something else gets messed up and eventually
KoColorSpace
will fail to find a suitable dithering op and trigger an assert because the color depths will be different.
Edited by Maciej Jesionowski