Skip to content

Commit fb1b987

Browse files
author
Swagtoy
committed
Remove incremental scrolling
Didn't seem to work on the contentdb and likely wouldn't work in any code that just regenerates the scrollbar or something odd. Bug for another day.
1 parent 50a7fac commit fb1b987

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

src/gui/guiScrollBar.cpp

+3-6
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ GUIScrollBar::GUIScrollBar(IGUIEnvironment *environment, IGUIElement *parent, s3
2525
dragged_by_slider(false), tray_clicked(false), scroll_pos(0),
2626
draw_center(0), thumb_size(0), min_pos(0), max_pos(100), small_step(10),
2727
large_step(50), drag_offset(0), page_size(100), border_size(0),
28-
m_tsrc(tsrc), target_pos(0.0f), variable_step(0.0f)
28+
m_tsrc(tsrc), target_pos(0.0f)
2929
{
3030
refreshControls();
3131
setNotClipped(false);
@@ -90,9 +90,7 @@ bool GUIScrollBar::OnEvent(const SEvent &event)
9090
s8 d = event.MouseInput.Wheel < 0 ? -1 : 1;
9191
s8 h = is_horizontal ? 1 : -1;
9292

93-
// NOTE: Is this noticable at all?
94-
variable_step += d;
95-
setPosInterpolated(getTargetPos() + ((event.MouseInput.Wheel + variable_step) * small_step * h));
93+
setPosInterpolated(getTargetPos() + (event.MouseInput.Wheel * small_step * h));
9694
return true;
9795
}
9896
break;
@@ -205,8 +203,7 @@ void GUIScrollBar::interpolatePos()
205203
// effectively disabled at <= 30 FPS.
206204
f32 amount = 0.2f * (last_delta_ms / 16.667f);
207205
setPosRaw(interpolate_scroll(scroll_pos, target_pos, amount));
208-
variable_step *= 0.9f;
209-
206+
210207
SEvent e;
211208
e.EventType = EET_GUI_EVENT;
212209
e.GUIEvent.Caller = this;

src/gui/guiScrollBar.h

-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ class GUIScrollBar : public IGUIElement
9696
void setPosRaw(const s32 &pos);
9797
void updatePos();
9898
f32 target_pos;
99-
f32 variable_step;
10099
u32 last_time_ms = 0;
101100
u32 last_delta_ms = 17; // assume 60 FPS
102101
void interpolatePos();

0 commit comments

Comments
 (0)