Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions code/scroll.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -501,8 +501,10 @@ void ScrollClass::Scroll_Edge(Point2D const & point)
** If the mouse button is pressed or auto scrolling is active, then scroll
** the map if the delay counter indicates.
*/
distance = int(_rate[rate] * Rule->ScrollMultiplier);
Scroll_Map(facing, distance, true);
if (Counter == 0) {
distance = int(_rate[rate] * Rule->ScrollMultiplier);
Scroll_Map(facing, distance, true);
}

if (Counter == 0 && player_scrolled) {
Counter = SCROLL_DELAY;
Expand Down
14 changes: 14 additions & 0 deletions manual/changes/edge-scroll-timing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: Pace edge scrolling with the system timer
category: fix
release: 0.2.0
targets:
- type: key
id: ScrollRate
effect: changed
credit: [Krisztiaan]
---

Edge scrolling now moves the tactical map once per system-timer tick. It previously moved
once per main-loop frame while using the timer only to adjust acceleration, so directions
that rendered faster also scrolled faster.
2 changes: 1 addition & 1 deletion manual/content/keys/scrollrate.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ when_omitted:
value: "3"
---

Resting the pointer against the edge of the screen scrolls the map, and the map gathers speed the longer the pointer is held there. The distance covered each frame comes from a fixed table of nine steps, and this figure fixes how far along that table the map may climb: `0` allows the second-longest of the nine steps and `6` a short one; the longest step in the table is out of reach for every figure the file can sensibly carry. Holding the right mouse button down while the map is scrolling from the edge shortens the step instead of lengthening it, and pins it to the slower half of the table. [`ScrollMultiplier`](/keys/scrollmultiplier/) then scales whatever step was chosen.
Resting the pointer against the edge of the screen scrolls the map, and the map gathers speed the longer the pointer is held there. The distance covered when the system-timer countdown expires comes from a fixed table of nine steps, so a faster main loop does not increase the edge-scroll rate. This figure fixes how far along that table the map may climb: `0` allows the second-longest of the nine steps and `6` a short one; the longest step in the table is out of reach for every figure the file can sensibly carry. Holding the right mouse button down while the map is scrolling from the edge shortens the step instead of lengthening it, and pins it to the slower half of the table. [`ScrollMultiplier`](/keys/scrollmultiplier/) then scales whatever step was chosen.

The figure also divides the coast-scroll distance described by [`ScrollMethod`](/keys/scrollmethod/): the further the pointer is dragged from the point where the right button went down, the further the map moves, and this figure plus one is what that offset is divided by.

Expand Down