Commit 750fc8fc authored by Cyrille Berger's avatar Cyrille Berger
Browse files

forward port fix crash when using color range on translated images

CCBUG:135148

svn path=/trunk/koffice/; revision=599746
parent 6f093152
......@@ -80,23 +80,21 @@ QImage KisSelection::maskImage() const
{
// If part of a KisAdjustmentLayer, there may be no parent device.
QImage img;
qint32 x, y, w, h, y2, x2;
QRect bounds;
if (m_parentPaintDevice) {
m_parentPaintDevice->exactBounds(x, y, w, h);
img = QImage(w, h, QImage::Format_RGB32);
bounds = m_parentPaintDevice->exactBounds();
bounds = bounds.intersect( m_parentPaintDevice->image()->bounds() );
img = QImage(bounds.width(), bounds.height(), 32);
}
else {
x = 0;
y = 0;
w = image()->width();
h = image()->width();
img = QImage(w, h, QImage::Format_RGB32);
bounds = QRect( 0, 0, image()->width(), image()->height());
img = QImage(bounds.width(), bounds.height(), 32);
}
for (y2 = y; y2 < h - y; ++y2) {
KisHLineConstIteratorPixel it = createHLineConstIterator(x, y2, w);
x2 = 0;
KisHLineConstIteratorPixel it = createHLineConstIterator(bounds.x(), bounds.y(), bounds.width());
for (int y2 = bounds.y(); y2 < bounds.height() - bounds.y(); ++y2) {
int x2 = 0;
while (!it.isDone()) {
quint8 s = MAX_SELECTED - *(it.rawData());
qint32 c = qRgb(s, s, s);
......
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