Fix T38488: Single pixel line artifact with Rotate and Wrapped Translate

nodes.

The Rotate node was calculating the center with a 1 pixel offset, which
effectively shifts the image by 1 pixel on one or both axis for
right-angle (90 degree) rotations.

Note that the wrapping feature for translate nodes can still produce
undesirable results for non-quadratic images. This is because of how
the resolution calculation works atm: the Rotate node will keep the
resolution of the input image, even if the resulting image is then
cropped or leaves empty margins. There is no easy way to fix that
without redesign.
This commit is contained in:
Lukas Tönne 2014-02-18 18:55:35 +01:00
parent f5ae5698d0
commit d516fedba3
Notes: blender-bot 2023-02-14 11:14:34 +01:00
Referenced by issue #38488, Single pixel line artifact with Rotate and Wrapped Translate nodes
1 changed files with 2 additions and 2 deletions

View File

@ -38,8 +38,8 @@ void RotateOperation::initExecution()
{
this->m_imageSocket = this->getInputSocketReader(0);
this->m_degreeSocket = this->getInputSocketReader(1);
this->m_centerX = this->getWidth() / 2.0;
this->m_centerY = this->getHeight() / 2.0;
this->m_centerX = (getWidth() - 1) / 2.0;
this->m_centerY = (getHeight() - 1) / 2.0;
}
void RotateOperation::deinitExecution()