RPTools / maptool

Virtual Tabletop for playing roleplaying games with remote players or face to face.
http://rptools.net
GNU Affero General Public License v3.0
787 stars 259 forks source link

[Bug]: Resize issues after rotating Object/Background element #4844

Closed whitebenoit closed 2 days ago

whitebenoit commented 3 months ago

Describe the Bug

When resizeable elements (objects and backgrounds) are rotated, they show strange behaviour when being resized. Their centres move strangely and the resize handle does not stay under the mouse.

To Reproduce

  1. Open a new campaign
  2. Select "Object" Layer (alternatively select "Background")
  3. From the library add any image on the map. Here, I used "Default>Cards>c10"
  4. Select the newly added element and, using the Shift+Ctrl+Mouse-Wheel rotate it a few degrees (e.g. 10°) so it's not in any multiple of 90°.
  5. Using the resize icon, try to resize the image. Result : The image will move strangely which also makes resizing difficult.

Expected Behaviour

I would use the normal behaviour, which keeps the opposite corner (by default top left) of the resize handle (by default bottom right) static. I would then expect the same "opposite" corner to stay static in its rotated position and the rest to be resized so that the handle stays at the mouse position. In case of resizing relative to the centre of the image, I would expect this centre to remain static and the handle stays at the mouse position.

Screenshots

Example of the resize issue where the card has been added (left image), rotated (middle) and "resized" (right). MapTool_Bug_ResizeAfterRotate_

MapTool Info

1.14.3

Desktop

Windows

Additional Context

This bug has been occurring ever since I started using map tool quite a while ago (5 years, good job btw guys on the software) so it should not be a recent regression.

==== MapTool Information ==== MapTool Version: 1.14.3 MapTool Home...: C:\Users\WhitePC.maptool-rptools MapTool Install: C:\Users\WhitePC\AppData\Local\MapTool\app Max mem avail..: 3 GB Max mem used...: 180 MB Custom Property: -DMAPTOOL_LOGDIR=C:\Users\WhitePC.maptool-rptools\logs Custom Property: -DMAPTOOL_DATADIR=.maptool-rptools

==== Java Information ==== Java Home......: C:\Users\WhitePC\AppData\Local\MapTool\runtime Java Vendor....: Eclipse Adoptium Java Version...: 20.0.1 Java Parameters: -Djpackage.app-version=1.0 -Xss8M -Dsun.java2d.d3d=false -Dsentry.environment=Production -Dfile.encoding=UTF-8 -Dpolyglot.engine.WarnInterpreterOnly=false -Djava.util.Arrays.useLegacyMergeSort=true -XX:+ShowCodeDetailsInExceptionMessages --add-opens=java.desktop/java.awt=ALL-UNNAMED --add-opens=java.desktop/java.awt.geom=ALL-UNNAMED --add-opens=java.desktop/sun.awt.geom=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=javafx.web/javafx.scene.web=ALL-UNNAMED --add-opens=javafx.web/com.sun.webkit=ALL-UNNAMED --add-opens=javafx.web/com.sun.webkit.dom=ALL-UNNAMED --add-opens=java.desktop/javax.swing=ALL-UNNAMED --add-opens=java.desktop/sun.awt.shell=ALL-UNNAMED --add-opens=java.desktop/com.sun.java.swing.plaf.windows=ALL-UNNAMED -Djpackage.app-path=C:\Users\WhitePC\AppData\Local\MapTool\MapTool.exe

==== OS Information ==== OS Name........: Windows 10 OS Version.....: 10.0 OS Architecture: amd64 Processor......: AMD64 Family 23 Model 113 Stepping 0, AuthenticAMD PATH...........: C:\Users\WhitePC\AppData\Local\MapTool;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\Program Files (x86)\Eclipse Adoptium\jre-17.0.9.9-hotspot\bin;C:\Program Files\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Razer Chroma SDK\bin;C:\Program Files\Razer Chroma SDK\bin;C:\Program Files (x86)\Razer\ChromaBroadcast\bin;C:\Program Files\Razer\ChromaBroadcast\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\AMD\StoreMI\ECmd;E:\Program Files\CMake\bin;E:\opencv\build\x64\vc15\bin;C:\Program Files\dotnet\;C:\Program Files (x86)\CodeBlocks\MinGW\bin;E:\opencv2\build\install\x64\vc16;C:\Users\WhitePC\AppData\Local\Microsoft\WindowsApps;C:\Users\WhitePC.dotnet\tools;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;E:\Program Files\Go\bin;C:\Program Files\Git\cmd;C:\Program Files\Crucial\Crucial Storage Executive;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Users\WhitePC\AppData\Local\Programs\Python\Python39\Scripts\;C:\Users\WhitePC\AppData\Local\Programs\Python\Python39\;C:\Users\WhitePC\AppData\Local\Programs\Python\Python38-32\Scripts\;C:\Users\WhitePC\AppData\Local\Programs\Python\Python38-32\;C:\Users\WhitePC\AppData\Local\Microsoft\WindowsApps;C:\Users\WhitePC\AppData\Local\GitHubDesktop\bin;C:\Users\WhitePC\AppData\Local\Microsoft\WindowsApps;C:\Users\WhitePC\go\bin;C:\Program Files\Java\jre1.8.0_321\bin;C:\Users\WhitePC.dotnet\tools;C:\Program Files\Java\jdk-17\bin;;C:\Users\WhitePC\AppData\Local\MapTool\app;. Number of Procs: 16

==== User Information ==== User Name: WhitePC User Home: C:\Users\WhitePC User Dir.: C:\Users\WhitePC\AppData\Local\MapTool

==== Network Interfaces ==== Display Name..: Software Loopback Interface 1 Interface Name: lo Address...: 127.0.0.1 Address...: 0:0:0:0:0:0:0:1

Display Name..: Realtek PCIe GbE Family Controller Interface Name: eth5 Address...: 192.168.1.61 Address...: 2001:861:30c1:bf90:5af5:6755:ef0e:15f1 Address...: 2001:861:30c1:bf90:849b:6708:7db2:3134 Address...: fe80:0:0:0:ff18:c2d8:8b7a:a641%eth5

Display Name..: LogMeIn Hamachi Virtual Ethernet Adapter Interface Name: eth6 Address...: 2620:9b:0:0:0:0:1927:39af Address...: fe80:0:0:0:58e4:50f6:a747:9757%eth6

Host Address...: 192.168.1.61 Default Gateway: 192.168.1.254

==== Locale Information ==== Country.: United States Language: English Locale..: English (United States) Variant.:

==== Encoding Information ==== Default Locale: en_US Default Charset: UTF-8 file.encoding: UTF-8 sun.jnu.encoding: Cp1252 Default Encoding: UTF8

==== Display Information ==== Number of Displays: 2 Display 1: 1920x1080(32) Display 2: 1920x1080(32)

==== Internet Gateway Devices ==== No IGDs Found!