Skip to content

Commit 69c5643

Browse files
committed
TextBubble: Request redraw when setting text
1 parent d6190ef commit 69c5643

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/scratch/textbubble.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,10 @@ void TextBubble::setText(const std::string &text)
7575
if (!impl->text.empty()) {
7676
IEngine *eng = engine();
7777

78-
if (eng)
78+
if (eng) {
7979
eng->moveDrawableToFront(this);
80+
eng->requestRedraw();
81+
}
8082
}
8183
}
8284

test/scratch_classes/textbubble_test.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ TEST(TextBubbleTest, BubbleText)
4040
EngineMock engine;
4141
bubble.setEngine(&engine);
4242
EXPECT_CALL(engine, moveDrawableToFront(&bubble));
43+
EXPECT_CALL(engine, requestRedraw());
4344
bubble.setText("world");
4445
ASSERT_EQ(bubble.text(), "world");
4546
bubble.setEngine(nullptr);

0 commit comments

Comments
 (0)