Commit 78407d41 authored by Halla Rempt's avatar Halla Rempt
Browse files

Don't crash when trying to ctrl-alt pick a color from a group layer.

parent 3f76017c
......@@ -299,8 +299,16 @@ bool KisToolPaint::pickColor(const QPointF &documentPixel,
int resource = toForegroundColor ?
KoCanvasResourceManager::ForegroundColor : KoCanvasResourceManager::BackgroundColor;
KisPaintDeviceSP device = fromCurrentNode ?
currentNode()->paintDevice() : image()->projection();
KisPaintDeviceSP device;
if (fromCurrentNode) {
device = currentNode()->projection();
if (!device) {
device = currentNode()->projection();
}
}
else {
device = image()->projection();
}
QPoint imagePoint = image()->documentToIntPixel(documentPixel);
......
......@@ -25,6 +25,7 @@ namespace KisToolUtils {
KoColor pick(KisPaintDeviceSP dev, const QPoint& pos)
{
KIS_ASSERT(dev);
KoColor pickedColor;
dev->pixel(pos.x(), pos.y(), &pickedColor);
pickedColor.setOpacity(OPACITY_OPAQUE_U8);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment