KisPasteActionFactories.cpp (krita-5.1.3.tar.xz) | : | KisPasteActionFactories.cpp (krita-5.1.4.tar.xz) | ||
---|---|---|---|---|
skipping to change at line 308 | skipping to change at line 308 | |||
} | } | |||
} | } | |||
void KisPasteIntoActionFactory::run(KisViewManager *viewManager) | void KisPasteIntoActionFactory::run(KisViewManager *viewManager) | |||
{ | { | |||
if (!viewManager->activeDevice()) return; | if (!viewManager->activeDevice()) return; | |||
KisImageSP image = viewManager->image(); | KisImageSP image = viewManager->image(); | |||
if (!image) return; | if (!image) return; | |||
const KisPaintDevice *clipdev = KisClipboard::instance()->clipFromKritaLayer | if (!KisClipboard::instance()->hasLayers()) return; | |||
s(image->bounds(), | ||||
KisPaintDeviceSP clipdev = KisClipboard::instance()->clipFromKritaLayers(ima | ||||
ge->bounds(), | ||||
imag e->colorSpace()).data(); | imag e->colorSpace()).data(); | |||
KisPaintDeviceSP clip = new KisPaintDevice(*clipdev); | KisPaintDeviceSP clip = new KisPaintDevice(*clipdev); | |||
if (clip) { | if (clip) { | |||
QRect clipBounds = clip->exactBounds(); | QRect clipBounds = clip->exactBounds(); | |||
QPoint diff = image->bounds().center() - clipBounds.center(); | QPoint diff = image->bounds().center() - clipBounds.center(); | |||
clip->setX(diff.x()); | clip->setX(diff.x()); | |||
clip->setY(diff.y()); | clip->setY(diff.y()); | |||
} | } | |||
End of changes. 1 change blocks. | ||||
2 lines changed or deleted | 4 lines changed or added |