Bug 431813 - Wrong drawing of the bounding box when using free transform tool and rotation
Summary: Wrong drawing of the bounding box when using free transform tool and rotation
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Tools/Transform (other bugs)
Version First Reported In: git master (please specify the git hash!)
Platform: Manjaro Linux
: NOR normal
Target Milestone: ---
Assignee: Dmitry Kazakov
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2021-01-19 11:24 UTC by Deif Lou
Modified: 2021-02-11 07:02 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
sample image (261.29 KB, image/jpeg)
2021-01-19 11:24 UTC, Deif Lou
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Deif Lou 2021-01-19 11:24:24 UTC
Created attachment 134993 [details]
sample image

SUMMARY
Sometimes, when using the free transform tool and setting the rotation, the bounding box in the canvas is not drawn correctly. It seems to happen under very specific conditions. For example, I can only reproduce it if I have selected the breeze style, and only under specific ranges of sizes, and only if the image is loaded from disk.

STEPS TO REPRODUCE
1. Open krita master and set the breeze style
2. Open the attached image
3. Select the transform tool with the free transform mode and change the rotation.

OBSERVED RESULT
The on-canvas bounding box is not drawn correctly over the transformed image

EXPECTED RESULT
The on-canvas bounding box should be drawn in the borders of the transformed image

SOFTWARE/OS VERSIONS
Operating System: Manjaro Linux
KDE Plasma Version: 5.20.4
KDE Frameworks Version: 5.77.0
Qt Version: 5.15.2
Comment 1 Deif Lou 2021-01-19 11:31:16 UTC
Here is a screenshot of the effect: https://i.imgur.com/DotJmjs.png
Comment 2 Deif Lou 2021-01-19 11:51:05 UTC
It only happens with instant preview activated
Comment 3 Ahab Greybeard 2021-01-25 12:19:07 UTC
I can reproduce this effect with the Jan 24 5.0.0 prealpha (git c0eb189) appimage.
It does not happen with the Jan 24 4.4.3alpha (git a5ed936) appimage.

I have different conditions from the OP, as follows:
It happens for opened files or images created from scratch, for Instant Preview on or off, for the Windows style or the Fusion style (I don't see Breeze).

For the size of image, it happens for a canvas size greater than 1000 pixels.
For a small image, the content follows the bounding box quickly.
For larger images, the content lags the bounding box movement in steps and this lag effect increases as the image gets larger up to 1000 pixels in size.
At a size of 1024 x 1024, the image content lags in steps and does not get to the required size/shape in order to match the transform bounding box.
Comment 4 Ahab Greybeard 2021-01-25 12:19:53 UTC
Krita

 Version: 5.0.0-prealpha (git c0eb189)
 Languages: en_GB, en, en, en_GB, en
 Hidpi: false

Qt

  Version (compiled): 5.12.9
  Version (loaded): 5.12.9

OS Information

  Build ABI: x86_64-little_endian-lp64
  Build CPU: x86_64
  CPU: x86_64
  Kernel Type: linux
  Kernel Version: 4.19.0-13-amd64
  Pretty Productname: Debian GNU/Linux 10 (buster)
  Product Type: debian
  Product Version: 10
  Desktop: MATE

OpenGL Info
 
  Vendor:  "NVIDIA Corporation" 
  Renderer:  "GeForce GTX 750 Ti/PCIe/SSE2" 
  Version:  "4.6.0 NVIDIA 450.80.02" 
  Shading language:  "4.60 NVIDIA" 
  Requested format:  QSurfaceFormat(version 3.0, options QFlags<QSurfaceFormat::FormatOption>(DeprecatedFunctions), depthBufferSize 24, redBufferSize 8, greenBufferSize 8, blueBufferSize 8, alphaBufferSize 8, stencilBufferSize 8, samples -1, swapBehavior QSurfaceFormat::DoubleBuffer, swapInterval 0, colorSpace QSurfaceFormat::DefaultColorSpace, profile  QSurfaceFormat::CompatibilityProfile) 
  Current format:    QSurfaceFormat(version 4.6, options QFlags<QSurfaceFormat::FormatOption>(DeprecatedFunctions), depthBufferSize 24, redBufferSize 8, greenBufferSize 8, blueBufferSize 8, alphaBufferSize 8, stencilBufferSize 8, samples -1, swapBehavior QSurfaceFormat::DoubleBuffer, swapInterval 0, colorSpace QSurfaceFormat::DefaultColorSpace, profile  QSurfaceFormat::CompatibilityProfile) 
     Version: 4.6
     Supports deprecated functions true 
     is OpenGL ES: false
Comment 5 Dmitry Kazakov 2021-02-11 05:57:23 UTC
Okay, I can confirm. The problem happens only in "perspective rotation" mode.
Comment 6 Dmitry Kazakov 2021-02-11 06:47:15 UTC
Git commit 9496063db3e86835870fbf36a59734e35a62a606 by Dmitry Kazakov.
Committed on 11/02/2021 at 06:46.
Pushed by dkazakov into branch 'master'.

Fix wrong in-place preview when doing perspective rotations

We should scale camera positions as well.

M  +1    -2    plugins/tools/tool_transform2/strokes/inplace_transform_stroke_strategy.cpp
M  +8    -1    plugins/tools/tool_transform2/tool_transform_args.cc
M  +1    -1    plugins/tools/tool_transform2/tool_transform_args.h

https://invent.kde.org/graphics/krita/commit/9496063db3e86835870fbf36a59734e35a62a606
Comment 7 Ahab Greybeard 2021-02-11 07:02:28 UTC
@Dmitry re. "We should scale camera positions as well."

https://bugs.kde.org/show_bug.cgi?id=418557 seems related.