From 9bf163d51a252fb5a611e88c2e0b4123a98169e1 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sat, 17 Oct 2020 09:40:10 +0200 Subject: Matrix: show reply messages embedded in messages that reply to them, like element does --- src/Text.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/Text.cpp') diff --git a/src/Text.cpp b/src/Text.cpp index c1adc5d..a00d068 100644 --- a/src/Text.cpp +++ b/src/Text.cpp @@ -38,6 +38,7 @@ namespace QuickMedia dirtyCaret(false), editable(false), caretMoveDirection(CaretMoveDirection::NONE), + num_lines(1), lineSpacing(0.0f), characterSpacing(0.0f), caretIndex(0), @@ -96,8 +97,10 @@ namespace QuickMedia if(std::abs(maxWidth - this->maxWidth) > 1.0f) { this->maxWidth = maxWidth; - dirty = true; - dirtyCaret = true; + if(num_lines > 1 || maxWidth < boundingBox.width) { + dirty = true; + dirtyCaret = true; + } } } @@ -383,7 +386,7 @@ namespace QuickMedia float text_wrap_offset = 0.0f; float text_offset_y = 0.0f; int last_space_index = -1; - int num_lines = 1; + num_lines = 1; // TODO: Binary search? for(int i = 0; i < (int)vertices_linear.size(); ++i) { VertexRef &vertex_ref = vertices_linear[i]; -- cgit v1.2.3