Git commit af220de6e2b364c37888ab66359d63fcd3aa525c by Sven Langkamp. Committed on 01/12/2011 at 00:54. Pushed by langkamp into branch 'master'. don't paste layers outside the bounds of the image BUG:287818 M +7 -0 krita/ui/kis_selection_manager.cc http://commits.kde.org/calligra/af220de6e2b364c37888ab66359d63fcd3aa525c diff --git a/krita/ui/kis_selection_manager.cc b/krita/ui/kis_selection_man= ager.cc index ef15c6f..3893808 100644 --- a/krita/ui/kis_selection_manager.cc +++ b/krita/ui/kis_selection_manager.cc @@ -423,6 +423,13 @@ void KisSelectionManager::paste() viewConverter->viewToDocumentX(canvasBase->canvasController()-= >canvasOffsetX()) + center.x(), viewConverter->viewToDocumentY(canvasBase->canvasController()-= >canvasOffsetY()) + center.y())); = + // Pasted layer content could be outside image bounds and invisible, i= f that is the case move content into the bounds + QRect exactBounds =3D clip->exactBounds(); + if(!exactBounds.isEmpty() && !exactBounds.intersects(image->bounds()))= { + clip->setX(clip->x() - exactBounds.x()); + clip->setY(clip->y() - exactBounds.y()); + } + if (clip) { KisPaintLayer *layer =3D new KisPaintLayer(image.data(), image->ne= xtLayerName() + i18n("(pasted)"), OPACITY_OPAQUE_U8, clip); Q_CHECK_PTR(layer);