Modify ↓

Opened 2 years ago

Closed 12 days ago

#23863 closed enhancement (fixed)

[Patch] Feature request: Add action to center viewport to position of the cursor

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

Description

I am aware of View > Viewport following, but it does not suit my needs because:
1) It does not work with FastDraw plugin ( https://josm.openstreetmap.de/ticket/12663 )
2) even if it did, it leads to too many slow refocusing of the viewport after each click/placing of a node. Especially when I map curved features (meandering rivers, uneven forrest boundaries) I place the new nodes fairly close to each other. When viewport following is enabled, each centering takes almost a second. By that time, I might have already placed another node. Even if it were instanteous, my brain needs some time to understand how the viewport moved, so I would like to have control about the timing of the viewport refocus.

So instead, I would really appreciate an action (available as shortcut) that would move center of the viewport to the position of my mouse.

Now my workflow is:
1) Add new nodes by clicking (or using spacebar when using the fastdraw plugin) until I reach an edge of the viewport.
2) Right click, move the vieport by mouse dragging and go back to 1). It takes several seconds at least.

New workflow would be
1) The same.
2) Use keyboard shortcut, viewport refocuses, no mouse dragging needed, I go back to 1), several seconds saved.

Attachments (3)

23863_center_view_at_mouse.patch​ (1.4 KB ) - added by felagund 5 weeks ago.
23863_center_view_at_mouse.2.patch​ (1.4 KB ) - added by felagund 5 weeks ago.
The proposed action without shortcut by defaul
23863_center_view_at_mouse_ctrl_home.patch​ (1.4 KB ) - added by felagund 5 weeks ago.
the action with CTRL+Home as default

Download all attachments as: .zip

Change History (7)

by felagund, 5 weeks ago

by felagund, 5 weeks ago

The proposed action without shortcut by defaul

by felagund, 5 weeks ago

the action with CTRL+Home as default

comment:1 by felagund, 5 weeks ago

So I implemented this. Well, asked a LLM to implement it, but it turned out it was very simple, all the plumbing is already there! I wish I knew:-). But anyway, I stested it and it works amazingly for my workflow described above.

It does exactly what I asked. I by mistake uplaode it three times. But two patches are correct - one sets CTRL+HOME default shortcut to this action, the other one leaves it unset. I think it is actually a good idea to assign shortcut, as it only has effect when mouse is somewhere over the map. CTRL+HOME still works over lists etc.

comment:2 by stoecker, 5 weeks ago

Milestone: → 26.09

comment:3 by felagund, 5 weeks ago

Summary: Feature request: Add action to center viewport to position of the cursor → [Patch] Feature request: Add action to center viewport to position of the cursor

comment:4 by stoecker, 12 days ago

Resolution: → fixed
Status: new → closed

In 19656/josm:

fix #23863 - add center to mouse position action for map (silent fail when outside of view screen) - patch by felagund

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


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