Modify

Opened 3 days ago

#24845 new defect

[HiDPI] Native Scale button in Layer List does not trigger 1:1 zoom (ScaleFactor remains > 1.0)

Reported by: DressyPear4 Owned by: team
Priority: normal Milestone:
Component: Core Version:
Keywords: Cc:

Description

Environment:

OS: Windows with HiDPI display scaling enabled (e.g., 125%)

Java2D Transform: 1.25x1.25

Description:
Under HiDPI scaling (125%), toggling the "scale follows native resolution of this layer" button (NativeScaleLayerCheckBox) in the Layers panel sets the layer as NativeScaleLayer, but fails to recalculate the map view zoom factor. Consequently, the layer's ScaleFactor remains around ~1.426, causing Java2D to resample and render the tiles blurry.

In contrast, selecting "Zoom to native resolution" (ZoomToNativeLevelAction) from the layer context menu properly executes mapView.zoomToFactor(Math.sqrt(scaleFactor)). This forces ScaleFactor down to 1.0 (true 1:1 pixel rendering), producing a crisp display.
It also occurs in dialogs with SplitMapChooserDialog.

Steps to Reproduce:

Set Windows display scaling to 125%.

Open JOSM and load a TMS imagery layer (e.g., OpenStreetMap Carto).

Click the Native Scale column icon in the Layers panel.

Observed: Imagery remains blurry (ScaleFactor ≈ 1.426).

Right-click the imagery layer and select Zoom to native resolution.

Observed: Imagery becomes sharp (ScaleFactor ≈ 1.0).

Diagnostic Log:

-- INITIAL / AFTER TOGGLING LAYER LIST BUTTON (Blurry) --
HiDPI OS Scale: 125%
MapView Java2D Transform: 1.25x1.25
MapView.getScale(): 5.0
Layer ScaleFactor: 1.4264201857048473
Calculated Native Factor: 1.1943283408279515

-- AFTER EXECUTING 'Zoom to native resolution' (Crisp 1:1) --
MapView.getScale(): 5.971641704139757
Layer ScaleFactor: 0.9999999999994497 (~1.0)
Calculated Native Factor: 0.9999999999997248

Attachments (3)

Zoom_before.png (714.9 KB ) - added by DressyPear4 3 days ago.
Zoom_before.2.png (714.9 KB ) - added by DressyPear4 3 days ago.
Zoom_after.png (1.0 MB ) - added by DressyPear4 3 days ago.

Change History (3)

by DressyPear4, 3 days ago

Attachment: Zoom_before.png added

by DressyPear4, 3 days ago

Attachment: Zoom_before.2.png added

by DressyPear4, 3 days ago

Attachment: Zoom_after.png added

Modify Ticket

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

Add Comment


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