aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/MessageBoard.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/MessageBoard.cpp b/src/MessageBoard.cpp
index 9dbeb71..1c8c4ad 100644
--- a/src/MessageBoard.cpp
+++ b/src/MessageBoard.cpp
@@ -32,6 +32,7 @@ namespace dchat
const float LINE_SIDE_PADDING = 20.0f;
const float LINE_HEIGHT = 1.0f;
const float USERNAME_TIMESTAMP_SIDE_PADDING = 10.0f;
+ const double SCROLL_MAX_SPEED = 20.0;
const LineColor LINE_COLOR
{
@@ -121,6 +122,10 @@ namespace dchat
else if(event.type == sf::Event::MouseWheelScrolled && event.mouseWheelScroll.wheel == sf::Mouse::Wheel::VerticalWheel)
{
scrollSpeed += (event.mouseWheelScroll.delta * 5.0);
+ if(scrollSpeed > SCROLL_MAX_SPEED)
+ scrollSpeed = SCROLL_MAX_SPEED;
+ else if(scrollSpeed < -SCROLL_MAX_SPEED)
+ scrollSpeed = -SCROLL_MAX_SPEED;
}
if(selectingText && !leftMouseButtonPressed)