Opened 2 years ago
Last modified 34 hours ago
#23863 new enhancement
[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)
Change History (6)
by , 5 days ago
| Attachment: | 23863_center_view_at_mouse.patch added |
|---|
by , 5 days ago
| Attachment: | 23863_center_view_at_mouse.2.patch added |
|---|
by , 5 days ago
| Attachment: | 23863_center_view_at_mouse_ctrl_home.patch added |
|---|
the action with CTRL+Home as default
comment:1 by , 5 days 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 , 4 days ago
| Milestone: | → 26.09 |
|---|
comment:3 by , 34 hours 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 |
|---|



The proposed action without shortcut by defaul