From 607b15dbc2e1dfa8633e7ae679b709fe21c94599 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 29 Apr 2018 12:29:01 +0200 Subject: Fix image ratio, implement scroll locking (cant scroll outside messages) --- src/Chatbar.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/Chatbar.cpp') diff --git a/src/Chatbar.cpp b/src/Chatbar.cpp index e88986a..f68d363 100644 --- a/src/Chatbar.cpp +++ b/src/Chatbar.cpp @@ -300,4 +300,11 @@ namespace dchat if(blinkElapsedTime > BLINK_TIME_VISIBLE_MS + BLINK_TIME_INVISIBLE_MS) blinkTimer.restart(); } + + float Chatbar::getHeight() + { + const float fontSize = FONT_SIZE * Settings::getScaling(); + const float fontHeight = ResourceCache::getFont("fonts/Roboto-Regular.ttf")->getLineSpacing(fontSize); + return PADDING_TOP + floor(fontHeight * 1.7f + BOX_PADDING_Y * 2.0f) + PADDING_BOTTOM; + } } -- cgit v1.2.3