From ace74fe3915d6a72d65400a2ce3d456957198dfb Mon Sep 17 00:00:00 2001 From: David Capello Date: Mon, 14 Sep 2015 13:03:01 -0300 Subject: [PATCH] Copy dragged image correctly when the transparent color isn't mask (fix #808) --- src/app/ui/editor/pixels_movement.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/app/ui/editor/pixels_movement.cpp b/src/app/ui/editor/pixels_movement.cpp index a52d35769..dd840ee43 100644 --- a/src/app/ui/editor/pixels_movement.cpp +++ b/src/app/ui/editor/pixels_movement.cpp @@ -677,7 +677,13 @@ void PixelsMovement::drawImage(doc::Image* dst, const gfx::Point& pt, bool rende BlendMode::SRC); color_t maskColor = m_maskColor; - if (m_opaque) { + + // In case that Opaque option is enabled, or if we are drawing the + // image for the clipboard (renderOriginalLayer is false), we use a + // dummy mask color to call drawParallelogram(). In this way all + // pixels will be opaqued (all colors are copied) + if (m_opaque || + !renderOriginalLayer) { if (m_originalImage->pixelFormat() == IMAGE_INDEXED) maskColor = -1; else