Fix issue 374: Selection is distorted when it's moved and RotSprite is on

Don't use RotSprite until the angle or the size of the image is changed.
This commit is contained in:
David Capello 2014-08-12 07:19:58 -03:00
parent ebca329112
commit 37ac1444bd

View File

@ -615,7 +615,17 @@ void PixelsMovement::drawParallelogram(raster::Image* dst, raster::Image* src,
const gfx::Transformation::Corners& corners,
const gfx::Point& leftTop)
{
switch (UIContext::instance()->settings()->selection()->getRotationAlgorithm()) {
RotationAlgorithm rotAlgo = UIContext::instance()->settings()->selection()->getRotationAlgorithm();
// If the angle and the scale weren't modified, we should use the
// fast rotation algorithm, as it's pixel-perfect match with the
// original selection when just a translation is applied.
if (m_currentData.angle() == 0.0 &&
m_currentData.bounds().getSize() == src->size()) {
rotAlgo = kFastRotationAlgorithm;
}
switch (rotAlgo) {
case kFastRotationAlgorithm:
image_parallelogram(dst, src,