Bug 445731

Summary: Free Transform Tool Rotation in erratic angles
Product: [Applications] krita Reporter: Scroptels Gluzar <scroptelsgl>
Component: Tools/TransformAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: rojasreinold
Priority: NOR    
Version First Reported In: 5.0.0-beta2   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Scroptels Gluzar 2021-11-19 02:52:07 UTC
This is a bug of the free transformation tool of krita, one of the modes found in the transform tool options.

STEPS TO REPRODUCE
1. In a new layer paint some lines or dots
2. select the transform tool with the free transformation mode on
3. click outside the area of the transformation box and drag the mouse around the object to rotate clockwise/counterclockwise.
4. repeat the last step multiple times in different spots around the object's pivot point (left, right, top, bottom, top left, bottom right etc.) 
Aditionally scaling the object and/or moving it's pivot before rotating around will cause more extreme erratic behaviours

OBSERVED RESULT
We can use the tool options docker and checking the rotation option on the list to observe what is happening more easily.

Depending on the initial position where the user started rotating the object (right side, left side, etc.) the object may rotate normally until reaching a specific degree of rotation, if the user continues to rotate the object beyond that number the object will rotate 180 degrees on itself, after that it will start rotating in the opposite direction to that of the user's intention until coming back to the specific degree of rotation where this visual error ocurred, after this rotation will resume to normal. This behavior will repeat if the user continues to rotate the object.

Aditionally if the object is scaled around the x or y axis and then the user performs the previous action, the behaviour of the tool will be more erratic, rotating small amounts and then fliping around suddenly.

This bug also makes it so If the pivot point of the object is moved the object will not rotate in a full 360° degrees, skipping suddenly to another value.

Other observations:
This bug is not present in any of the other transformation modes of the tool.
The bug seems related to the size of the transformation in the tool, but the type (pixel or vector selections) and form of the selection, or if it's transforming multple selections doesn't affect it
Rotating the object on the x or y axis with the mouse also shows some weird behaviours (but that may be unrelated to this bug idk)

EXPECTED RESULT
The user should be able to rotate a selected region on the canvas in 360 degrees of rotation following the user's cursor using the free transformation tool, unaffected by any changes in scale.

SOFTWARE/OS VERSIONS
Windows: 10 home
Versión	20H2

ADDITIONAL INFORMATION

Krita

 Version: 5.0.0-beta2
 Languages: en_US, en, es, en_US, en, en_US, en, es, en_US, en, en_US, en, es, en_US, en, en_US, en, es, en_US, en, es_MX, es, es_ES, es, en_US, en
 Hidpi: true

Qt

  Version (compiled): 5.12.11
  Version (loaded): 5.12.11

OS Information

  Build ABI: x86_64-little_endian-llp64
  Build CPU: x86_64
  CPU: x86_64
  Kernel Type: winnt
  Kernel Version: 10.0.19042
  Pretty Productname: Windows 10 (10.0)
  Product Type: windows
  Product Version: 10

OpenGL Info
 
  Vendor:  "ATI Technologies Inc." 
  Renderer:  "AMD Radeon(TM) Vega 8 Graphics" 
  Version:  "3.0.13596 Compatibility Profile Context 20.10.12.09 27.20.11012.9001" 
  Shading language:  "4.60" 
  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 3.0, options QFlags<QSurfaceFormat::FormatOption>(DeprecatedFunctions), depthBufferSize 24, redBufferSize 8, greenBufferSize 8, blueBufferSize 8, alphaBufferSize 8, stencilBufferSize 8, samples 0, swapBehavior QSurfaceFormat::DoubleBuffer, swapInterval 1, colorSpace QSurfaceFormat::sRGBColorSpace, profile  QSurfaceFormat::NoProfile) 
     Version: 3.0
     Supports deprecated functions true 
     is OpenGL ES: false 
  supportsBufferMapping: true 
  supportsBufferInvalidation: true 

QPA OpenGL Detection Info 
  supportsDesktopGL: true 
  supportsAngleD3D11: true 
  isQtPreferAngle: true 

useBufferInvalidation (config option): false


Hardware Information

  GPU Acceleration: desktop
  Memory: 14214 Mb
  Number of Cores: 8
  Swap Location: C:/Users/ginel/AppData/Local/Temp

Current Settings

  Current Swap Location: C:/Users/ginel/AppData/Local/Temp
  Current Swap Location writable: true
  Undo Enabled: true
  Undo Stack Limit: 30
  Use OpenGL: true
  Use OpenGL Texture Buffer: true
  Disable Vector Optimizations: false
  Disable AVX Optimizations: false
  Canvas State: OPENGL_SUCCESS
  Autosave Interval: 900
  Use Backup Files: true
  Number of Backups Kept: 1
  Backup File Suffix: ~
  Backup Location: C:/Users/ginel
  Backup Location writable: true
  Use Win8 Pointer Input: false
  Use RightMiddleTabletButton Workaround: false
  Levels of Detail Enabled: true
  Use Zip64: false


Display Information
Number of screens: 1
	Screen: 0
		Name: \\.\DISPLAY1
		Depth: 32
		Scale: 1
		Resolution in pixels: 1920x1080
		Manufacturer: 
		Model: 
		Refresh Rate: 60

SESSION: 18 Nov 2021 14:10:23 -0600. Executing C:\Program Files\Krita (x64)\bin\krita.exe

Krita Version: 5.0.0-beta2, Qt version compiled: 5.12.11, loaded: 5.12.11. Process ID: 9076
-- -- -- -- -- -- -- --
18 Nov 2021 14:10:23 -0600: Style: fusion. Available styles: windowsvista, Windows, Fusion
18 Nov 2021 14:10:31 -0600: Database is up to date. Version: 0.0.13, created by Krita 5.0.0-beta2, at mié. nov. 17 05:18:12 2021
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/Cross01.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/Cross02.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/Cross03.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/Cross04.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/Cross05.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/Cross06.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/Cross07.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/Crumpled_Paper.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/DITH_0202_CLUS.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/DITH_0202_GEN_.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/DITH_0202_HORZ.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/DITH_0202_VERT.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/DITH_0404_ALT_.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/DITH_0404_BL22.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/DITH_0404_CLUS.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/DITH_0404_CURL.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/DITH_0404_DIAG.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/DITH_0404_ELL2.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/DITH_0404_ELL3.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/DITH_0404_ELLS.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/DITH_0404_GEN_.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/DITH_0404_HORZ.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/DITH_0404_SHUR.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/DITH_0404_SLIC.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/DITH_0404_VERT.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/DITH_0404_WAV2.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/DITH_0404_WAVE.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/DITH_0404_ZORO.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/DITH_0808_BL22_v.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/DITH_0808_BL22.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/DITH_0808_BUBL.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/DITH_0808_CIRC.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/DITH_0808_CLUS.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/DITH_0808_DIAM.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/DITH_0808_PANL.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/DITH_0808_SPOT.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/DITH_0808_SWRL.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/DITH_0808_WAVE.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/DITH_3232_CSTR.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/Grid01.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/Grid02.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/Grid03.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/Grid04.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/Grid05.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/HR_PastelPaper_02.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/HR_Wall_Paper.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/Pattern01.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/Pattern02.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/Pattern03.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/Pattern04.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/Pattern05.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/Pattern06.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/Squares01.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/Squares02.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/Squares03.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/Squares04.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/Squares05.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/Squares06.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/Squares07.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/Squares08.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/Squares09.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/Squares10.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/Stripes02.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/Stripes03.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/Stripes04.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/Stripes05.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/Stripes06.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/Stripes07.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/Stripes08.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/Stripes09.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/Zigzag01.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/Zigzag02.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/Zigzag03.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/Zigzag04.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/fractal_pattern.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/generic_paper1.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/generic_paper2.pat
18 Nov 2021 14:10:37 -0600: Could not load resourcepatterns/hexacolBW__2.pat
18 Nov 2021 14:10:38 -0600: Non-store package - creating updater
18 Nov 2021 14:12:01 -0600: Removing autosave file C:/Users/ginel/AppData/Local/Temp/.krita-7336-document_0-autosave.kra
18 Nov 2021 15:17:50 -0600: Created image "Unnamed", 1800 * 2300 pixels, 72 dpi. Color model: 8-bit integer/channel RGB/Alpha (sRGB-elle-V2-srgbtrc.icc). Layers: 2
18 Nov 2021 18:26:04 -0600: Saving Document  as C:/Users/ginel/Pictures/dibujos/krita/buggy files/transform rotation bug.kra (mime: application/x-krita). 1800 * 2300 pixels, 3 layers.  101 frames, 24 framerate. Export configuration: No configuration
18 Nov 2021 18:26:04 -0600: Converting from application/x-krita to application/x-krita. Location: C:/Users/ginel/Pictures/dibujos/krita/buggy files/transform rotation bug.kra. Real location: C:/Users/ginel/Pictures/dibujos/krita/buggy files/transform rotation bug.kra. Batchmode: 0. Configuration: none
18 Nov 2021 18:26:04 -0600: Completed saving C:/Users/ginel/Pictures/dibujos/krita/buggy files/transform rotation bug.kra (mime: application/x-krita). Result: OK. Size: 8234775. MD5 Hash: %5
18 Nov 2021 18:26:04 -0600: Saving Completed
18 Nov 2021 18:47:13 -0600: Autosaving: C:/Users/ginel/Pictures/dibujos/krita/buggy files/.transform rotation bug.kra-autosave.kra
18 Nov 2021 18:47:13 -0600: Converting from application/x-krita to application/x-krita. Location: C:/Users/ginel/Pictures/dibujos/krita/buggy files/.transform rotation bug.kra-autosave.kra. Real location: C:/Users/ginel/Pictures/dibujos/krita/buggy files/.transform rotation bug.kra-autosave.kra. Batchmode: 0. Configuration: none
18 Nov 2021 18:47:13 -0600: Completed saving C:/Users/ginel/Pictures/dibujos/krita/buggy files/.transform rotation bug.kra-autosave.kra (mime: application/x-krita). Result: OK. Size: 4713990. MD5 Hash: %5
18 Nov 2021 19:17:29 -0600: Autosaving: C:/Users/ginel/Pictures/dibujos/krita/buggy files/.transform rotation bug.kra-autosave.kra
18 Nov 2021 19:17:29 -0600: Converting from application/x-krita to application/x-krita. Location: C:/Users/ginel/Pictures/dibujos/krita/buggy files/.transform rotation bug.kra-autosave.kra. Real location: C:/Users/ginel/Pictures/dibujos/krita/buggy files/.transform rotation bug.kra-autosave.kra. Batchmode: 0. Configuration: none
18 Nov 2021 19:17:29 -0600: Completed saving C:/Users/ginel/Pictures/dibujos/krita/buggy files/.transform rotation bug.kra-autosave.kra (mime: application/x-krita). Result: OK. Size: 4675137. MD5 Hash: %5
18 Nov 2021 20:11:30 -0600: Autosaving: C:/Users/ginel/Pictures/dibujos/krita/buggy files/.transform rotation bug.kra-autosave.kra
18 Nov 2021 20:11:30 -0600: Converting from application/x-krita to application/x-krita. Location: C:/Users/ginel/Pictures/dibujos/krita/buggy files/.transform rotation bug.kra-autosave.kra. Real location: C:/Users/ginel/Pictures/dibujos/krita/buggy files/.transform rotation bug.kra-autosave.kra. Batchmode: 0. Configuration: none
18 Nov 2021 20:11:30 -0600: Completed saving C:/Users/ginel/Pictures/dibujos/krita/buggy files/.transform rotation bug.kra-autosave.kra (mime: application/x-krita). Result: OK. Size: 4683262. MD5 Hash: %5
18 Nov 2021 20:19:10 -0600: Importing application/x-krita to application/x-krita. Location: C:/Users/ginel/Pictures/dibujos/krita/buggy files/free transform rotation bug.kra. Real location: C:/Users/ginel/Pictures/dibujos/krita/buggy files/free transform rotation bug.kra. Batchmode: 0
18 Nov 2021 20:19:11 -0600: Loaded image from application/x-krita. Size: 1800 * 2300 pixels, 1 dpi. Color model: 8-bit integer/channel RGB/Alpha (sRGB-elle-V2-srgbtrc.icc). Layers: 3
18 Nov 2021 20:34:11 -0600: Autosaving: C:/Users/ginel/Pictures/dibujos/krita/buggy files/.free transform rotation bug.kra-autosave.kra
18 Nov 2021 20:34:21 -0600: Autosaving: C:/Users/ginel/Pictures/dibujos/krita/buggy files/.free transform rotation bug.kra-autosave.kra
18 Nov 2021 20:34:31 -0600: Autosaving: C:/Users/ginel/Pictures/dibujos/krita/buggy files/.free transform rotation bug.kra-autosave.kra
18 Nov 2021 20:34:41 -0600: Autosaving: C:/Users/ginel/Pictures/dibujos/krita/buggy files/.free transform rotation bug.kra-autosave.kra
18 Nov 2021 20:44:43 -0600: Autosaving: C:/Users/ginel/Pictures/dibujos/krita/buggy files/.free transform rotation bug.kra-autosave.kra
18 Nov 2021 20:44:43 -0600: Converting from application/x-krita to application/x-krita. Location: C:/Users/ginel/Pictures/dibujos/krita/buggy files/.free transform rotation bug.kra-autosave.kra. Real location: C:/Users/ginel/Pictures/dibujos/krita/buggy files/.free transform rotation bug.kra-autosave.kra. Batchmode: 0. Configuration: none
18 Nov 2021 20:44:44 -0600: Completed saving C:/Users/ginel/Pictures/dibujos/krita/buggy files/.free transform rotation bug.kra-autosave.kra (mime: application/x-krita). Result: OK. Size: 4696350. MD5 Hash: %5
Comment 1 Reinold Rojas 2021-12-01 21:06:11 UTC
This has been fixed in this MR: https://invent.kde.org/graphics/krita/-/merge_requests/1192
Also it has been back ported to Krita 5.0 branch https://invent.kde.org/graphics/krita/-/commit/4a37f6e39e1385c840788c0a292d83cdc654aa99