SUMMARY STEPS TO REPRODUCE 1. Create a selection with Rectangular Selection tool, transform the selected part. 2. Enable grid view and Snap to grid option, scale the selected part to match the grid, apply selection. OBSERVED RESULT The image exceed 1 pixel wide after transformed, even after snapped to the grid. It can happen to all 4 sides of the transformed image. EXPECTED RESULT The image's pixels fit exactly what is preview when in transform mode / fit exactly to the grid. SOFTWARE/OS VERSIONS Windows: 10 macOS: Linux/KDE Plasma: (available in About System) KDE Plasma Version: KDE Frameworks Version: Qt Version: ADDITIONAL INFORMATION Screenshot https://prnt.sc/pqn4gt
Created attachment 123619 [details] The screenshot
I can reproduce this. At first I thought it was an issue with snapping and zoom level, but even placing the transform handles pixel perfect can result in this 1 pixel overshoot on 1 or more edges after applying the transformation.
It looks like there is a mismatch in the active preview of the Transform Tool. I can click and press ESC repeatedly on the previous 1-pixel-off transform result and see that the corner handles and image preview align exactly with the grid.
I can still reproduce that
Git commit 26ddc0bed921d20f4331f25e4383752cffa8580e by Dmitry Kazakov. Committed on 25/05/2021 at 12:26. Pushed by dkazakov into branch 'master'. Fix pixel alignment when using transform tool on pixel art There were two problems: 1) KisTransformWorker accepted the offset measured in integers, which created a small drift of the whole image 2) KisFilterWeightsApplicator calculated the destination rect too aggressively. The formula might be okay for the filters that have whole-pixel support, but for half-pixel-support filters it caused issues. M +2 -2 libs/image/kis_filter_weights_applicator.h M +11 -6 libs/image/kis_transform_worker.cc M +2 -2 libs/image/kis_transform_worker.h M +42 -0 libs/image/tests/kis_transform_worker_test.cpp M +3 -0 libs/image/tests/kis_transform_worker_test.h M +2 -2 plugins/tools/tool_transform2/kis_transform_utils.cpp https://invent.kde.org/graphics/krita/commit/26ddc0bed921d20f4331f25e4383752cffa8580e
*** Bug 429937 has been marked as a duplicate of this bug. ***