Modify

Opened 5 days ago

Last modified 17 hours ago

#24695 assigned defect

Unpredictable result when scaling or rotating an object again

Reported by: GerdP Owned by: GerdP
Priority: normal Milestone:
Component: Core Version:
Keywords: template_report Cc:

Description (last modified by GerdP)

What steps will reproduce the problem?

  1. Select a shape, eg a building
  2. Rotate it a bit
  3. Rotate it a bit again

What is the expected result?

Shape is close to the result of the first rotate action, just a bit rotated

What happens instead?

Shape is rotated to a completely unexpected position.

Please provide any additional information below. Attach a screenshot if possible.

An old bug. This is just annoying. One has to undo the first rotation and do it again. This doesn't happen with move mode, only with scale and rotation. There seems to be code to handle this but it doesn't work. Problem gets worser when I zoom to close to one node.

Revision:19556
Is-Local-Build:true
Build-Date:2026-04-06 16:55:24

Identification: JOSM/1.5 (19556 SVN en) Windows 11 64-Bit
OS Build number: Windows 10 Pro 25H2 (26200)
Memory Usage: 2716 MB / 6144 MB (857 MB allocated, but free)
Java version: 21.0.2+13-LTS, Azul Systems, Inc., OpenJDK 64-Bit Server VM
Look and Feel: com.sun.java.swing.plaf.windows.WindowsLookAndFeel
Screen: \Display0 1920x1080x32bpp@60Hz (scaling 1.00×1.00)
Maximum Screen Size: 1920×1080
Best cursor sizes: 16×16→32×32, 32×32→32×32
System property file.encoding: UTF-8
System property sun.jnu.encoding: Cp1252
Locale info: en_DE
Numbers with default locale: 1234567890 -> 1234567890
VM arguments: [-Djpackage.app-version=1.5.19039, --add-modules=java.scripting,java.sql,javafx.controls,javafx.media,javafx.swing,javafx.web, --add-exports=java.base/sun.security.action=ALL-UNNAMED, --add-exports=java.desktop/com.sun.imageio.plugins.jpeg=ALL-UNNAMED, --add-exports=java.desktop/com.sun.imageio.spi=ALL-UNNAMED, --add-opens=java.base/java.lang=ALL-UNNAMED, --add-opens=java.base/java.nio=ALL-UNNAMED, --add-opens=java.base/jdk.internal.loader=ALL-UNNAMED, --add-opens=java.base/jdk.internal.ref=ALL-UNNAMED, --add-opens=java.desktop/javax.imageio.spi=ALL-UNNAMED, --add-opens=java.desktop/javax.swing.text.html=ALL-UNNAMED, --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED, -Djpackage.app-path=%UserProfile%\AppData\Local\JOSM\JOSM HWConsole.exe]
Dataset consistency test: No problems found

Plugins:
+ OpeningHoursEditor (36474)
+ apache-commons (36474)
+ buildings_tools (36474)
+ comfort0 (36474)
+ ejml (36474)
+ geotools (36474)
+ jackson (36474)
+ jaxb (36474)
+ jts (36474)
+ o5m (36474)
+ opendata (36474)
+ pbf (36474)
+ photo_geotagging (36474)
+ poly (36474)
+ reverter (36474)
+ terracer (36484)
+ undelete (36474)
+ utilsplugin2 (36497)

Tagging presets:
+ c:\josm\core\resources\data\defaultpresets.xml

Map paint styles:
+ c:\josm\core\resources\styles\standard\elemstyles.mapcss

Validator rules:
+ d:\java_tools\JOSM\mygeometry.mapcss
+ https://josm.openstreetmap.de/josmfile?page=Rules/GermanySpecific&zip=1
+ c:\josm\core\resources\data\validator\combinations.mapcss
+ c:\josm\core\resources\data\validator\geometry.mapcss

Last errors/warnings:
- 04372.085 W: java.io.IOException: Attribution is not loaded yet
- 04372.085 W: java.io.IOException: Attribution is not loaded yet
- 04372.085 W: java.io.IOException: Attribution is not loaded yet
- 04372.086 W: java.io.IOException: Attribution is not loaded yet
- 04372.086 W: java.io.IOException: Attribution is not loaded yet
- 04372.087 W: java.io.IOException: Attribution is not loaded yet
- 04372.087 W: java.io.IOException: Attribution is not loaded yet
- 04372.088 W: java.io.IOException: Attribution is not loaded yet
- 04372.089 W: java.io.IOException: Attribution is not loaded yet
- 04372.089 W: java.io.IOException: Attribution is not loaded yet

Attachments (1)

24695.patch (7.4 KB ) - added by GerdP 18 hours ago.
change code to handle repeated scale or rotation, add check that warns when there is at least one download area and one or more modified nodes are outside

Download all attachments as: .zip

Change History (4)

comment:1 by GerdP, 5 days ago

Description: modified (diff)
Owner: changed from team to GerdP
Status: newassigned
Summary: Unpredictable result when rotating an object againUnpredictable result when scaling or rotating an object again

I'll try to find out what wrong.

comment:2 by GerdP, 4 days ago

OK, the problem with rotation is that JOSM calculates an angle using the current cursor position. When you move the cursor the the new angle is calculated and the difference is translated into a rotation angle. When the rotation mode is stopped and started again while the cursor is at exactly the same position, this works well. When the cursor is moved to a different position and rotation is started again the calculation of the new angle fails.
For the move mode, I think the code to handle this problem is in method MoveCommand.changeStartPoint(). We need something like that for rotate and scale as well.

by GerdP, 18 hours ago

Attachment: 24695.patch added

change code to handle repeated scale or rotation, add check that warns when there is at least one download area and one or more modified nodes are outside

comment:3 by GerdP, 17 hours ago

I'll work with this patch for a few days to see if the new check is too annoying. I found a problem with one of the existing checks regarding movement of hidden elements.
Maybe I'll separate the two different changes.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as assigned The owner will remain GerdP.
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from GerdP to the specified user. Next status will be 'new'.
Next status will be 'needinfo'. The owner will be changed from GerdP to GerdP.
as duplicate The resolution will be set to duplicate. Next status will be 'closed'. The specified ticket will be cross-referenced with this ticket.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.