koffice/krita/plugins/paintops/defaultpaintops/duplicate
Cyrille Berger
cyb at lepi.org
Sun Apr 26 18:02:06 CEST 2009
SVN commit 959589 by berger:
Fix: crash when selecting "correct perspective" in the duplicate paint op.
Need review for backport in branch.
CCMAIL:kimageshop at kde.org
M +5 -4 kis_duplicateop.cpp
M +0 -1 kis_duplicateop.h
--- trunk/koffice/krita/plugins/paintops/defaultpaintops/duplicate/kis_duplicateop.cpp #959588:959589
@@ -159,13 +159,14 @@
// Perspective correction ?
KisPainter copyPainter(m_srcdev);
- if (settings->perspectiveCorrection()) {
+ KisImageSP image = settings->m_image;
+ if (settings->perspectiveCorrection() && image && image->perspectiveGrid()->countSubGrids() == 1) {
Matrix3qreal startM = Matrix3qreal::Identity();
Matrix3qreal endM = Matrix3qreal::Identity();
// First look for the grid corresponding to the start point
- KisSubPerspectiveGrid* subGridStart = *m_image->perspectiveGrid()->begin();
- QRect r = QRect(0, 0, m_image->width(), m_image->height());
+ KisSubPerspectiveGrid* subGridStart = *image->perspectiveGrid()->begin();
+ QRect r = QRect(0, 0, image->width(), image->height());
#if 1
if (subGridStart) {
@@ -174,7 +175,7 @@
#endif
#if 1
// Second look for the grid corresponding to the end point
- KisSubPerspectiveGrid* subGridEnd = *m_image->perspectiveGrid()->begin();
+ KisSubPerspectiveGrid* subGridEnd = *image->perspectiveGrid()->begin();
if (subGridEnd) {
endM = KisPerspectiveMath::computeMatrixTransfoToPerspective(*subGridEnd->topLeft(), *subGridEnd->topRight(), *subGridEnd->bottomLeft(), *subGridEnd->bottomRight(), r);
}
--- trunk/koffice/krita/plugins/paintops/defaultpaintops/duplicate/kis_duplicateop.h #959588:959589
@@ -60,7 +60,6 @@
const KisDuplicateOpSettings * settings;
KisPaintDeviceSP m_srcdev;
KisPaintDeviceSP m_target;
- KisImageSP m_image;
QPointF m_duplicateStart;
bool m_duplicateStartIsSet;
More information about the kimageshop
mailing list