From 6862a4934cdc8d0845c2d6e9b89410115f118e32 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sun, 15 Dec 2019 11:35:56 +0100 Subject: GRAPHICS: MACGUI: Lessen size of paragraph spacing --- graphics/macgui/mactext.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'graphics/macgui/mactext.cpp') diff --git a/graphics/macgui/mactext.cpp b/graphics/macgui/mactext.cpp index fa70861600..afc78a117d 100644 --- a/graphics/macgui/mactext.cpp +++ b/graphics/macgui/mactext.cpp @@ -377,16 +377,23 @@ int MacText::getLineWidth(int line, bool enforce) { int width = 0; int height = 0; + bool hastext = false; + for (uint i = 0; i < _textLines[line].chunks.size(); i++) { if (enforce) _textLines[line].chunks[i].font = nullptr; - if (!_textLines[line].chunks[i].text.empty()) + if (!_textLines[line].chunks[i].text.empty()) { width += _textLines[line].chunks[i].getFont()->getStringWidth(_textLines[line].chunks[i].text); + hastext = true; + } height = MAX(height, _textLines[line].chunks[i].getFont()->getFontHeight()); } + if (!hastext) + height -= 3; + _textLines[line].width = width; _textLines[line].height = height; -- cgit v1.2.3