--===============1029259436== Content-Type: multipart/signed; boundary="nextPart3506218.9z9NZzAvov"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit --nextPart3506218.9z9NZzAvov Content-Type: multipart/mixed; boundary="Boundary-01=_txbUFU9PzO5b26C" Content-Transfer-Encoding: 7bit Content-Disposition: inline --Boundary-01=_txbUFU9PzO5b26C Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline The attached two diffs must be ported to trunk -- they fix the selectedRect= ()=20 mess. I haven't got time to do that right now. =2D-=20 Boudewijn Rempt=20 http://www.valdyas.org/fading/index.cgi --Boundary-01=_txbUFU9PzO5b26C Content-Type: text/x-diff; charset="us-ascii"; name="selectedrect1.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="selectedrect1.diff" Index: plugins/tools/tool_crop/kis_tool_crop.cc =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2D-- plugins/tools/tool_crop/kis_tool_crop.cc (revision 602941) +++ plugins/tools/tool_crop/kis_tool_crop.cc (working copy) @@ -98,7 +98,7 @@ } else { =20 =2D m_rectCrop =3D device->selection()->exactBounds(); + m_rectCrop =3D device->selection()->selectedRect(); validateSelection(); crop(); } @@ -150,16 +150,16 @@ QPoint pos =3D e->pos().floorQPoint(); QRect b =3D img->bounds(); =20 =2D if (pos.x() < b.x())=20 + if (pos.x() < b.x()) pos.setX(b.x()); =2D else if (pos.x() > b.x() + b.width())=20 + else if (pos.x() > b.x() + b.width()) pos.setX(b.x() + b.width()); =20 if (pos.y() < b.y()) pos.setY(b.y()); else if (pos.y() > b.y() + b.height()) pos.setY(b.y() + b.height()); =2D =20 + m_selecting =3D true; =20 if( !m_haveCropSelection ) //if the selection is not set @@ -357,7 +357,7 @@ else if( m_mouseOnHandleType =3D=3D LowerLeft) m_mouseOnHandleType =3D LowerRight; } =2D =20 + m_rectCrop =3D m_rectCrop.normalize(); m_rectCrop =3D m_rectCrop.intersect( QRect(0,0, imageW= idth + 1, imageHeight + 1 ) ); m_dragStart =3D e->pos().floorQPoint(); Index: plugins/tools/selectiontools/kis_tool_select_contiguous.cc =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2D-- plugins/tools/selectiontools/kis_tool_select_contiguous.cc (revision = 602941) +++ plugins/tools/selectiontools/kis_tool_select_contiguous.cc (working cop= y) @@ -86,7 +86,7 @@ KisPaintDeviceSP dev; QPoint pos; =20 =2D if (e->button() !=3D QMouseEvent::LeftButton && e->button() !=3D= QMouseEvent::RightButton)=20 + if (e->button() !=3D QMouseEvent::LeftButton && e->button() !=3D Q= MouseEvent::RightButton) return; =20 if (!(img =3D m_subject->currentImg())) @@ -107,31 +107,31 @@ KisSelectionSP selection =3D fillpainter.createFloodSelection(pos.= x(), pos.y()); KisSelectedTransaction *t =3D 0; if (img->undo()) t =3D new KisSelectedTransaction(i18n("Contiguous= Area Selection"), dev); =2D =20 + if (!dev->hasSelection()) { dev->selection()->clear(); if(m_selectAction=3D=3DSELECTION_SUBTRACT) selection->invert(); } =2D =20 + switch (m_selectAction) { case SELECTION_SUBTRACT: dev->subtractSelection(selection); break; case SELECTION_ADD: =2D default:=20 + default: dev->addSelection(selection); break; =20 } =20 =2D dev->setDirty(selection->extent()); // A bit too wide, but that'= s not that bad + dev->setDirty(selection->selectedRect()); // A bit too wide, but t= hat's not that bad dev->emitSelectionChanged(); =20 =20 if (img->undo()) img->undoAdapter()->addCommand(t); =2D =20 + QApplication::restoreOverrideCursor(); } =20 @@ -215,7 +215,7 @@ this, SLOT(slotSetSampleMerged(int))); =20 l->addItem(new QSpacerItem(1, 1, QSizePolicy::Fixed, QSizePolicy::Expa= nding)); =2D =20 + return m_optWidget; } =20 Index: plugins/filters/imageenhancement/kis_simple_noise_reducer.cpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2D-- plugins/filters/imageenhancement/kis_simple_noise_reducer.cpp (revisi= on 602941) +++ plugins/filters/imageenhancement/kis_simple_noise_reducer.cpp (working = copy) @@ -74,27 +74,26 @@ threshold =3D 50; windowsize =3D 1; } =2D =20 + KisColorSpace* cs =3D src->colorSpace(); =2D Q_INT32 depth =3D cs->nColorChannels(); =2D =20 + // Compute the blur mask KisAutobrushShape* kas =3D new KisAutobrushCircleShape(2*windowsize+1,= 2*windowsize+1, windowsize, windowsize); =2D =20 + QImage mask; kas->createBrush(&mask); =2D =20 + KisKernelSP kernel =3D KisKernel::fromQImage(mask); =2D =20 + KisPaintDeviceSP interm =3D new KisPaintDevice(*src); KisConvolutionPainter painter( interm ); =20 if (m_progressDisplay) =2D m_progressDisplay->setSubject( &painter, true, true ); =20 + m_progressDisplay->setSubject( &painter, true, true ); =20 painter.beginTransaction("bouuh"); painter.applyMatrix(kernel, rect.x(), rect.y(), rect.width(), rect.hei= ght(), BORDER_REPEAT); =2D =20 + if (painter.cancelRequested()) { cancel(); } @@ -102,7 +101,7 @@ KisHLineIteratorPixel dstIt =3D dst->createHLineIterator(rect.x(), rec= t.y(), rect.width(), true ); KisHLineIteratorPixel srcIt =3D src->createHLineIterator(rect.x(), rec= t.y(), rect.width(), false); KisHLineIteratorPixel intermIt =3D interm->createHLineIterator(rect.x(= ), rect.y(), rect.width(), false); =2D =20 + for( int j =3D 0; j < rect.height(); j++) { while( ! srcIt.isDone() ) @@ -124,7 +123,7 @@ dstIt.nextRow(); intermIt.nextRow(); } =2D =20 + setProgressDone(); // Must be called even if you don't really support = progression } =20 Index: plugins/filters/blur/kis_wdg_blur.cc =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2D-- plugins/filters/blur/kis_wdg_blur.cc (revision 602941) +++ plugins/filters/blur/kis_wdg_blur.cc (working copy) @@ -34,12 +34,14 @@ =20 KisWdgBlur::KisWdgBlur( KisFilter* nfilter, QWidget * parent, const char *= name) : KisFilterConfigWidget ( parent, name ) { + Q_UNUSED( nfilter ); + QGridLayout *widgetLayout =3D new QGridLayout(this, 1, 1); m_widget =3D new WdgBlur(this); widgetLayout -> addWidget(m_widget,0,0); =2D =20 + linkSpacingToggled(true); =2D =20 + connect( widget()->bnLinkSize, SIGNAL(toggled(bool)), this, SLOT(linkS= pacingToggled( bool ))); connect( widget()->intHalfWidth, SIGNAL(valueChanged(int)),this,SLOT(s= pinBoxHalfWidthChanged(int))); connect( widget()->intHalfHeight, SIGNAL(valueChanged(int)),this,SLOT(= spinBoxHalfHeightChanged(int))); Index: plugins/paintops/defaultpaintops/kis_duplicateop.cc =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2D-- plugins/paintops/defaultpaintops/kis_duplicateop.cc (revision 602941) +++ plugins/paintops/defaultpaintops/kis_duplicateop.cc (working copy) @@ -49,7 +49,9 @@ =20 =20 KisDuplicateOp::KisDuplicateOp(KisPainter * painter) =2D : super(painter), m_srcdev(0), m_target(0) + : super(painter) + , m_target(0) + , m_srcdev(0) { } =20 @@ -168,7 +170,7 @@ // First look for the grid corresponding to the start point KisSubPerspectiveGrid* subGridStart =3D *device->image()->perspect= iveGrid()->begin();//device->image()->perspectiveGrid()->gridAt(KisPoint(sr= cPoint.x() +hotSpot.x(),srcPoint.y() +hotSpot.y())); QRect r =3D QRect(0,0, device->image()->width(), device->image()->= height()); =2D =20 + #if 1 if(subGridStart) { @@ -204,12 +206,12 @@ } #endif // kdDebug()<< " oouuuuh" << srcPointF << KisPerspectiveMath::matP= rod(startM, KisPerspectiveMath::matProd(endM, srcPointF ) ) << KisPerspect= iveMath::matProd(endM, KisPerspectiveMath::matProd(startM, srcPointF ) ); =2D =20 + // Compute the translation in the perspective transformation space: KisPoint positionStartPaintingT =3D KisPerspectiveMath::matProd(en= dM, m_painter->duplicateStart() ); KisPoint duplicateStartPoisitionT =3D KisPerspectiveMath::matProd(= endM, m_painter->duplicateStart() - m_painter->duplicateOffset() ); KisPoint translat =3D duplicateStartPoisitionT - positionStartPain= tingT; =2D KisRectIteratorPixel dstIt =3D m_srcdev->createRectIterator(0, 0= , sw, sh, true);=20 + KisRectIteratorPixel dstIt =3D m_srcdev->createRectIterator(0, 0, = sw, sh, true); KisRandomSubAccessorPixel srcAcc =3D device->createRandomSubAccess= or(); //Action while(!dstIt.isDone()) @@ -223,15 +225,15 @@ ++dstIt; } =20 =2D =20 + } else { // Or, copy the source data on the temporary device: copyPainter.bitBlt(0, 0, COMPOSITE_COPY, device, srcPoint.x(), src= Point.y(), sw, sh); copyPainter.end(); } =2D =20 + // heal ? =2D =20 + if(heal) { Q_UINT16 dataDevice[4]; @@ -271,7 +273,7 @@ iter++; } while( err < 0.00001 && iter < 100); } =2D =20 + // Finaly multiply deviceIt =3D device->createHLineIterator(x, y, sw, false ); srcDevIt =3D m_srcdev->createHLineIterator(0, 0, sw, true ); @@ -296,8 +298,8 @@ srcDevIt.nextRow(); } } =2D =20 =2D =20 + + // Add the dab as selection to the srcdev // KisPainter copySelection(srcdev->selection().data()); // copySelection.bitBlt(0, 0, COMPOSITE_OVER, dab, 0, 0, sw, sh); @@ -325,7 +327,7 @@ Q_INT32 sy =3D dstRect.y() - y; sw =3D dstRect.width(); sh =3D dstRect.height(); =2D =20 + if (m_source->hasSelection()) { m_painter->bltSelection(dstRect.x(), dstRect.y(), m_painter->compo= siteOp(), m_target, m_source->selection(), m_painter->opacity(= ), sx, sy, sw, sh); Index: core/kis_perspectivetransform_worker.cpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2D-- core/kis_perspectivetransform_worker.cpp (revision 602941) +++ core/kis_perspectivetransform_worker.cpp (working copy) @@ -74,7 +74,7 @@ { m_r =3D m_dev->exactBounds(); } =2D KisColorSpace * cs =3D m_dev->colorSpace(); +// KisColorSpace * cs =3D m_dev->colorSpace(); =20 kdDebug() << "r =3D " << m_r << endl; KisRectIteratorPixel dstIt =3D m_dev->createRectIterator(m_r.x(), m_r.= y(), m_r.width(), m_r.height(), true); @@ -100,7 +100,7 @@ =20 srcAcc.moveTo( p ); srcAcc.sampledOldRawData( dstIt.rawData() ); =2D =20 + // TODO: Should set alpha =3D alpha*(1-selectedness) // cs->setAlpha( dstIt.rawData(), 255, 1); } else { Index: core/kis_convolution_painter.cc =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2D-- core/kis_convolution_painter.cc (revision 603215) +++ core/kis_convolution_painter.cc (working copy) @@ -92,8 +92,6 @@ // Make the area we cover as small as possible if (m_device->hasSelection()) { =20 =2D =2D QRect r =3D m_device->selection()->selectedRect().intersect(QRect= (x, y, w, h)); x =3D r.x(); y =3D r.y(); Index: core/kis_paint_device.cc =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2D-- core/kis_paint_device.cc (revision 602941) +++ core/kis_paint_device.cc (working copy) @@ -208,7 +208,7 @@ } m_longRunningFilterTimer =3D 0; m_dcop =3D 0; =2D =20 + m_x =3D 0; m_y =3D 0; =20 @@ -243,7 +243,7 @@ KisPaintDevice::KisPaintDevice(KisLayer *parent, KisColorSpace * colorSpac= e, const char * name) : QObject(0, name), KShared(), m_exifInfo(0) { =2D =20 + m_longRunningFilterTimer =3D 0; m_dcop =3D 0; =20 @@ -264,7 +264,7 @@ } =20 Q_ASSERT( m_colorSpace ); =2D =20 + m_pixelSize =3D m_colorSpace->pixelSize(); m_nChannels =3D m_colorSpace->nChannels(); =20 @@ -276,7 +276,7 @@ Q_CHECK_PTR(m_datamanager); m_extentIsValid =3D true; =20 =2D =20 + m_longRunningFilters =3D m_colorSpace->createBackgroundFilters(); if (!m_longRunningFilters.isEmpty()) { m_longRunningFilterTimer =3D new QTimer(this); @@ -285,7 +285,7 @@ } } =20 =2D=20 + KisPaintDevice::KisPaintDevice(const KisPaintDevice& rhs) : QObject(), KSh= ared(rhs) { if (this !=3D &rhs) { @@ -520,7 +520,7 @@ Q_INT32 x, y, w, h, boundX2, boundY2, boundW2, boundH2; extent(x, y, w, h); extent(boundX2, boundY2, boundW2, boundH2); =2D =20 + const Q_UINT8* defaultPixel =3D m_datamanager->defaultPixel(); bool found =3D false; { @@ -600,12 +600,14 @@ =20 QRect KisPaintDevice::exactBounds() const { =2D QRect r1 =3D exactBoundsOldMethod(); + // XXX: Look, this code should never have gone into a release, + // right? + //QRect r1 =3D exactBoundsOldMethod(); QRect r2 =3D exactBoundsImprovedOldMethod(); =2D if(r1 !=3D r2) =2D { =2D kdDebug() << "EXACTBOUNDSERROR : " << r1 << " " << r2 << endl; =2D } + //if(r1 !=3D r2) + //{ + // kdDebug() << "EXACTBOUNDSERROR : " << r1 << " " << r2 << endl; + //} return r2; } =20 @@ -1075,7 +1077,7 @@ =20 QRect r =3D selection->selectedExactRect(); painter.bitBlt(r.x(), r.y(), COMPOSITE_ERASE, selection.data(), r.x(),= r.y(), r.width(), r.height()); =2D =20 + selection->invert(); painter.end(); } Index: core/kis_adjustment_layer.cc =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2D-- core/kis_adjustment_layer.cc (revision 602941) +++ core/kis_adjustment_layer.cc (working copy) @@ -39,7 +39,7 @@ m_showSelection =3D true; Q_ASSERT(m_cachedPaintDev); connect(img, SIGNAL(sigSelectionChanged(KisImageSP)), =2D this, SLOT(sigSelectionChanged(KisImageSP))); + this, SLOT(slotSelectionChanged(KisImageSP))); } =20 KisAdjustmentLayer::KisAdjustmentLayer(const KisAdjustmentLayer& rhs) @@ -53,7 +53,7 @@ if (!m_selection->hasSelection()) m_selection->setSelection(m_selection); connect(rhs.image(), SIGNAL(sigSelectionChanged(KisImageSP)), =2D this, SLOT(sigSelectionChanged(KisImageSP))); + this, SLOT(slotSelectionChanged(KisImageSP))); } m_cachedPaintDev =3D new KisPaintDevice( *rhs.m_cachedPaintDev.data() = ); m_showSelection =3D false; @@ -155,7 +155,7 @@ QRect KisAdjustmentLayer::extent() const { if (m_selection) =2D return m_selection->extent(); + return m_selection->selectedRect(); else if (image()) return image()->bounds(); else @@ -165,7 +165,7 @@ QRect KisAdjustmentLayer::exactBounds() const { if (m_selection) =2D return m_selection->exactBounds(); + return m_selection->selectedRect(); else if (image()) return image()->bounds(); else Index: core/kis_selection.cc =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2D-- core/kis_selection.cc (revision 602941) +++ core/kis_selection.cc (working copy) @@ -35,8 +35,12 @@ #include "kis_selection.h" =20 KisSelection::KisSelection(KisPaintDeviceSP dev) =2D : super(dev->parentLayer(), KisMetaRegistry::instance()->csRegistry(= )->getAlpha8(), (QString("selection for ") + dev->name()).latin1()), m_doCa= cheExactRect(false) =2D , m_parentPaintDevice(dev), m_dirty(false) + : super(dev->parentLayer() + , KisMetaRegistry::instance()->csRegistry()->getAlpha8() + , (QString("selection for ") + dev->name()).latin1()) + , m_parentPaintDevice(dev) + , m_doCacheExactRect(false) + , m_dirty(false) { Q_ASSERT(dev); } @@ -162,7 +166,7 @@ } =20 =20 =2DQRect KisSelection::selectedRect() +QRect KisSelection::selectedRect() const { if(*(m_datamanager->defaultPixel()) =3D=3D MIN_SELECTED || !m_parentPa= intDevice) return extent(); @@ -170,7 +174,7 @@ return extent().unite(m_parentPaintDevice->extent()); } =20 =2DQRect KisSelection::selectedExactRect() +QRect KisSelection::selectedExactRect() const { if(m_doCacheExactRect) return m_cachedExactRect; @@ -280,65 +284,65 @@ imageRectHeight =3D nonuniformRect.height(); =20 const Q_INT32 NUM_SELECTION_ROWS =3D 3; =2D =20 + Q_UINT8 *selectionRow[NUM_SELECTION_ROWS]; =2D =20 + Q_INT32 aboveRowIndex =3D 0; Q_INT32 centreRowIndex =3D 1; Q_INT32 belowRowIndex =3D 2; =2D =20 + selectionRow[aboveRowIndex] =3D new Q_UINT8[imageRectWidth + 2]; selectionRow[centreRowIndex] =3D new Q_UINT8[imageRectWidth + 2]; selectionRow[belowRowIndex] =3D new Q_UINT8[imageRectWidth + 2]; =2D =20 + readBytes(selectionRow[centreRowIndex], imageRectX - 1, imageRectY= - 1, imageRectWidth + 2, 1); readBytes(selectionRow[belowRowIndex], imageRectX - 1, imageRectY,= imageRectWidth + 2, 1); =2D =20 + for (Q_INT32 y =3D 0; y < imageRectHeight; ++y) { =2D =20 + Q_INT32 oldAboveRowIndex =3D aboveRowIndex; aboveRowIndex =3D centreRowIndex; centreRowIndex =3D belowRowIndex; belowRowIndex =3D oldAboveRowIndex; =2D =20 + readBytes(selectionRow[belowRowIndex], imageRectX - 1, imageRe= ctY + y + 1, imageRectWidth + 2, 1); =2D =20 + const Q_UINT8 *aboveRow =3D selectionRow[aboveRowIndex] + 1; const Q_UINT8 *centreRow =3D selectionRow[centreRowIndex] + 1; const Q_UINT8 *belowRow =3D selectionRow[belowRowIndex] + 1; =2D =20 + QRgb *imagePixel =3D reinterpret_cast(img.scanLine(ima= geRectOffsetY + y)); imagePixel +=3D imageRectOffsetX; =2D =20 + for (Q_INT32 x =3D 0; x < imageRectWidth; ++x) { =2D =20 + Q_UINT8 centre =3D *centreRow; =2D =20 + if (centre !=3D MAX_SELECTED) { =2D =20 + // this is where we come if the pixels should be blue = or bluish =2D =20 + QRgb srcPixel =3D *imagePixel; Q_UINT8 srcGrey =3D (qRed(srcPixel) + qGreen(srcPixel)= + qBlue(srcPixel)) / 9; Q_UINT8 srcAlpha =3D qAlpha(srcPixel); =2D =20 + // Colour influence is proportional to alphaPixel. srcGrey =3D UINT8_MULT(srcGrey, srcAlpha); =2D =20 + QRgb dstPixel; =2D =20 + if (centre =3D=3D MIN_SELECTED) { //this is where we come if the pixels should be bl= ue (or red outline) =2D =20 + Q_UINT8 left =3D *(centreRow - 1); Q_UINT8 right =3D *(centreRow + 1); Q_UINT8 above =3D *aboveRow; Q_UINT8 below =3D *belowRow; =2D =20 + // Stop unselected transparent areas from appearin= g the same // as selected transparent areas. Q_UINT8 dstAlpha =3D QMAX(srcAlpha, 192); =2D =20 + // now for a simple outline based on 4-connectivity if (left !=3D MIN_SELECTED || right !=3D MIN_SELEC= TED || above !=3D MIN_SELECTED || below !=3D MIN_SELECTED) { dstPixel =3D qRgba(255, 0, 0, dstAlpha); @@ -348,20 +352,20 @@ } else { dstPixel =3D qRgba(UINT8_BLEND(qRed(srcPixel), src= Grey + 128, centre), UINT8_BLEND(qGreen(srcPixel), src= Grey + 128, centre), =2D UINT8_BLEND(qBlue(srcPixel), sr= cGrey + 165, centre),=20 + UINT8_BLEND(qBlue(srcPixel), srcG= rey + 165, centre), srcAlpha); } =2D =20 + *imagePixel =3D dstPixel; } =2D =20 + aboveRow++; centreRow++; belowRow++; imagePixel++; } } =2D =20 + delete [] selectionRow[aboveRowIndex]; delete [] selectionRow[centreRowIndex]; delete [] selectionRow[belowRowIndex]; @@ -550,7 +554,7 @@ } else { dstPixel =3D qRgba(UINT8_BLEND(qRed(srcPixel), src= Grey + 128, centre), UINT8_BLEND(qGreen(srcPixel), src= Grey + 128, centre), =2D UINT8_BLEND(qBlue(srcPixel), sr= cGrey + 165, centre),=20 + UINT8_BLEND(qBlue(srcPixel), srcG= rey + 165, centre), srcAlpha); } =20 Index: core/kis_selection.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2D-- core/kis_selection.h (revision 602941) +++ core/kis_selection.h (working copy) @@ -85,6 +85,8 @@ /** * Tests if the the rect is totally outside the selection, but uses se= lectedRect * instead of selectedRect, and this is faster (but might deliver fals= e positives!) + * + * XXX: This comment makes no sense anymore! (BSAR) */ bool isProbablyTotallyUnselected(QRect r); =20 @@ -92,13 +94,13 @@ * Rough, but fastish way of determining the area * of the tiles used by the selection. */ =2D QRect selectedRect(); + QRect selectedRect() const; =20 /** * Slow, but exact way of determining the rectangle * that encloses the selection */ =2D QRect selectedExactRect(); + QRect selectedExactRect() const; =20 void paintSelection(QImage img, Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT= 32 h); void paintSelection(QImage img, const QRect& scaledImageRect, const QS= ize& scaledImageSize, const QSize& imageSize); Index: core/kis_fill_painter.cc =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2D-- core/kis_fill_painter.cc (revision 602941) +++ core/kis_fill_painter.cc (working copy) @@ -192,11 +192,10 @@ return; } =20 =2D int x, y, w, h; =2D m_selection->extent(x, y, w, h); + QRect rc =3D m_selection->selectedRect(); =20 =2D bltSelection(x, y, m_compositeOp, filled, m_selection, m_opacity, =2D x, y, w, h); + bltSelection(rc.x(), rc.y(), m_compositeOp, filled, m_selection, m_opa= city, + rc.x(), rc.y(), rc.width(), rc.height()); =20 emit notifyProgressDone(); =20 @@ -215,13 +214,16 @@ KisSelectionSP KisFillPainter::createFloodSelection(int startX, int startY= ) { if (m_width < 0 || m_height < 0) { if (m_device->hasSelection() && m_careForSelection) { =2D Q_INT32 x,y,w,h; =2D m_device->selection()->extent(x,y,w,h); =2D m_width =3D w - (startX - x); =2D m_height =3D h - (startY - y); + + QRect rc =3D m_device->selection()->selectedRect(); + m_width =3D rc.width() - (startX - rc.x()); + m_height =3D rc.height() - (startY - rc.y()); + } else if (m_device->image()) { + m_width =3D m_device->image()->width(); m_height =3D m_device->image()->height(); + } else { m_width =3D m_height =3D 500; } Index: ui/kis_selection_manager.cc =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2D-- ui/kis_selection_manager.cc (revision 602941) +++ ui/kis_selection_manager.cc (working copy) @@ -499,7 +499,7 @@ =20 KisPaintDeviceSP dev =3D img->activeDevice(); if (!dev) return; =2D =20 + KisSelectedTransaction * t =3D 0; if (img->undo()) t =3D new KisSelectedTransaction(i18n("Select All"), = dev); Q_CHECK_PTR(t); @@ -728,7 +728,7 @@ k->data[7] =3D 2; k->data[8] =3D 1; =20 =2D QRect rect =3D selection->extent(); + QRect rect =3D selection->selectedRect(); // Make sure we've got enough space around the edges. rect =3D QRect(rect.x() - 3, rect.y() - 3, rect.width() + 6, rect.heig= ht() + 6); rect &=3D QRect(0, 0, img->width(), img->height()); Index: ui/kis_view.cc =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2D-- ui/kis_view.cc (revision 602941) +++ ui/kis_view.cc (working copy) @@ -2477,10 +2477,12 @@ =20 void KisView::canvasGotEnterEvent(QEvent *e) { + Q_UNUSED( e ); } =20 void KisView::canvasGotLeaveEvent (QEvent *e) { + Q_UNUSED( e ); } =20 void KisView::canvasGotMouseWheelEvent(QWheelEvent *event) --Boundary-01=_txbUFU9PzO5b26C Content-Type: text/x-diff; charset="us-ascii"; name="selectedrect2.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="selectedrect2.diff" Index: plugins/tools/tool_perspectivetransform/kis_tool_perspectivetransfor= m.cc =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2D-- plugins/tools/tool_perspectivetransform/kis_tool_perspectivetransform= =2Ecc (revision 602941) +++ plugins/tools/tool_perspectivetransform/kis_tool_perspectivetransform.c= c (working copy) @@ -603,7 +603,7 @@ // Also restore the original selection. if(m_origSelection) { =2D QRect rc =3D m_origSelection->extent(); + QRect rc =3D m_origSelection->selectedRect(); rc =3D rc.normalize(); img->activeDevice()->selection()->clear(); KisPainter sgc(img->activeDevice()->selection().data()); Index: plugins/tools/tool_transform/kis_tool_transform.cc =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2D-- plugins/tools/tool_transform/kis_tool_transform.cc (revision 602941) +++ plugins/tools/tool_transform/kis_tool_transform.cc (working copy) @@ -769,7 +769,7 @@ // Also restore the original selection. if(m_origSelection) { =2D QRect rc =3D m_origSelection->extent(); + QRect rc =3D m_origSelection->selectedRect(); rc =3D rc.normalize(); img->activeDevice()->selection()->clear(); KisPainter sgc(img->activeDevice()->selection().data()); Index: core/kis_paint_device.cc =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2D-- core/kis_paint_device.cc (revision 603233) +++ core/kis_paint_device.cc (working copy) @@ -636,7 +636,7 @@ { QRect r; if (hasSelection()) { =2D r =3D selection()->exactBounds(); + r =3D selection()->selectedRect(); } else { r =3D exactBounds(); @@ -667,7 +667,7 @@ /* Read a line from bottom to top and and from top to bottom and write= their values to each other */ QRect r; if (hasSelection()) { =2D r =3D selection()->exactBounds(); + r =3D selection()->selectedRect(); } else { r =3D exactBounds(); @@ -1113,7 +1113,7 @@ =20 void KisPaintDevice::applySelectionMask(KisSelectionSP mask) { =2D QRect r =3D mask->extent(); + QRect r =3D mask->selectedRect(); crop(r); =20 for (Q_INT32 y =3D r.top(); y <=3D r.bottom(); ++y) { Index: core/kis_selection.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2D-- core/kis_selection.h (revision 603233) +++ core/kis_selection.h (working copy) @@ -119,6 +119,37 @@ void paintUniformSelectionRegion(QImage img, const QRect& imageRect, c= onst QRegion& uniformRegion); =20 private: + + // We don't want these methods to be used on selections: + void extent(Q_INT32 &x, Q_INT32 &y, Q_INT32 &w, Q_INT32 &h) const=20 + {=20 + KisPaintDevice::extent(x,y,w,h); + } + =20 + QRect extent() const { return KisPaintDevice::extent(); } + =20 + void exactBounds(Q_INT32 &x, Q_INT32 &y, Q_INT32 &w, Q_INT32 &h) const= =20 + { + return KisPaintDevice::exactBounds(x,y,w,h); + } =20 + + QRect exactBounds() const + { + return KisPaintDevice::extent(); + } + + QRect exactBoundsOldMethod() const=20 + { + return KisPaintDevice::exactBoundsOldMethod(); + } + + QRect exactBoundsImprovedOldMethod() const + { + return KisPaintDevice::exactBoundsImprovedOldMethod(); + } + + +private: KisPaintDeviceSP m_parentPaintDevice; bool m_doCacheExactRect; QRect m_cachedExactRect; Index: core/kis_paint_device.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2D-- core/kis_paint_device.h (revision 602941) +++ core/kis_paint_device.h (working copy) @@ -148,7 +148,7 @@ * For instance, the tiled datamanager keeps the extent to the nearest * multiple of 64. */ =2D void extent(Q_INT32 &x, Q_INT32 &y, Q_INT32 &w, Q_INT32 &h) const; + virtual void extent(Q_INT32 &x, Q_INT32 &y, Q_INT32 &w, Q_INT32 &h) co= nst; virtual QRect extent() const; =20 /** @@ -167,7 +167,7 @@ * Get the exact bounds of this paint device. This may be very slow, * especially on larger paint devices because it does a linear scanlin= e search. */ =2D void exactBounds(Q_INT32 &x, Q_INT32 &y, Q_INT32 &w, Q_INT32 &h) con= st; + virtual void exactBounds(Q_INT32 &x, Q_INT32 &y, Q_INT32 &w, Q_INT32 &= h) const; virtual QRect exactBounds() const; virtual QRect exactBoundsOldMethod() const; virtual QRect exactBoundsImprovedOldMethod() const; Index: ui/kis_grid_drawer.cpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2D-- ui/kis_grid_drawer.cpp (revision 602941) +++ ui/kis_grid_drawer.cpp (working copy) @@ -52,6 +52,7 @@ =20 void GridDrawer::drawPerspectiveGrid(KisImageSP image, const QRect& /*wr*/= , const KisSubPerspectiveGrid* grid) { + Q_UNUSED(image); KisConfig cfg; QPen mainPen =3D QPen ( cfg.getGridMainColor(), 1, gs2style( cfg.getGr= idMainStyle() ) ); QPen subdivisionPen =3D QPen ( cfg.getGridSubdivisionColor(), 1, gs2s= tyle( cfg.getGridSubdivisionStyle() ) ); @@ -74,7 +75,7 @@ KisPoint horizVanishingPoint =3D KisPerspectiveMath::computeIntersecti= on(d12,d34); KisPoint vertVanishingPoint =3D KisPerspectiveMath::computeIntersectio= n(d23,d41); =20 =2D for(uint i =3D 1; i < grid->subdivisions(); i ++) + for(uint i =3D 1; i < static_cast(grid->subdivisions()); i ++) { KisPoint pol1 =3D *grid->topRight() + i * v12; KisPerspectiveMath::LineEquation d1 =3D KisPerspectiveMath::comput= eLineEquation( &pol1, &vertVanishingPoint ); Index: ui/kis_perspective_grid_manager.cpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2D-- ui/kis_perspective_grid_manager.cpp (revision 602941) +++ ui/kis_perspective_grid_manager.cpp (working copy) @@ -30,7 +30,9 @@ #include "kis_view.h" =20 KisPerspectiveGridManager::KisPerspectiveGridManager(KisView * parent) =2D : QObject(), m_view(parent), m_toggleEdition(false) + : QObject() + , m_toggleEdition(false) + , m_view(parent) { =20 } --Boundary-01=_txbUFU9PzO5b26C-- --nextPart3506218.9z9NZzAvov Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) iD8DBQBFUbxtdaCcgCmN5d8RAqDlAJ9vf/4SmskR7PfgC2wtb7UnrpsymACeLpbm FrQPXUvDymr4Pmt1Q3qix0w= =YD2H -----END PGP SIGNATURE----- --nextPart3506218.9z9NZzAvov-- --===============1029259436== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ kimageshop mailing list kimageshop@kde.org https://mail.kde.org/mailman/listinfo/kimageshop --===============1029259436==--