...
 
Commits (2)
......@@ -275,7 +275,8 @@ void KisFillPainter::genericFillStart(int startX, int startY, KisPaintDeviceSP s
// Create a selection from the surrounding area
KisPixelSelectionSP pixelSelection = createFloodSelection(startX, startY, sourceDevice, selection()->pixelSelection());
KisPixelSelectionSP pixelSelection = createFloodSelection(startX, startY, sourceDevice,
(selection().isNull() ? 0 : selection()->pixelSelection()));
KisSelectionSP newSelection = new KisSelection(pixelSelection->defaultBounds());
newSelection->pixelSelection()->applySelection(pixelSelection, SELECTION_REPLACE);
m_fillSelection = newSelection;
......@@ -344,7 +345,7 @@ KisPixelSelectionSP KisFillPainter::createFloodSelection(KisPixelSelectionSP pix
KisScanlineFill gc(sourceDevice, startPoint, fillBoundsRect);
gc.setThreshold(m_threshold);
if (m_useSelectionAsBoundary) {
if (m_useSelectionAsBoundary && !pixelSelection.isNull()) {
gc.fillSelectionWithBoundary(pixelSelection, existingSelection);
} else {
gc.fillSelection(pixelSelection);
......
......@@ -125,7 +125,7 @@ void FillProcessingVisitor::fillPaintDevice(KisPaintDeviceSP device, KisUndoAdap
fillPainter.setFeather(m_feather);
fillPainter.setFillThreshold(m_fillThreshold);
fillPainter.setCareForSelection(true);
fillPainter.setUseSelectionAsBoundary((m_selection.isNull() || m_selection->hasNonEmptyPixelSelection()) ? m_useSelectionAsBoundary : false);
fillPainter.setUseSelectionAsBoundary((m_selection.isNull() || !m_selection->hasNonEmptyPixelSelection()) ? false : m_useSelectionAsBoundary);
fillPainter.setWidth(fillRect.width());
fillPainter.setHeight(fillRect.height());
fillPainter.setUseCompositioning(!m_useFastMode);
......