summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2018-11-26 21:46:48 +0100
committerGitHub <noreply@github.com>2018-11-26 21:46:48 +0100
commitc23710adde23a0e415097dee7d8e6f9ba76a0970 (patch)
treeb09662b674e747c8c78d62dbea9a28cbe76b293a
parenta92e885e55bd7cc3139eefe573a30a0ace2493ef (diff)
parenta04ba76d899ffdb9f486007f35be9ace91bdb01f (diff)
Merge pull request #24000 from allkhor/fix_tab_font_3.1
Ceil tabs font size
-rw-r--r--scene/gui/tabs.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/scene/gui/tabs.cpp b/scene/gui/tabs.cpp
index cf3113ca8c..4fe4271368 100644
--- a/scene/gui/tabs.cpp
+++ b/scene/gui/tabs.cpp
@@ -53,7 +53,7 @@ Size2 Tabs::get_minimum_size() const {
ms.width += get_constant("hseparation");
}
- ms.width += font->get_string_size(tabs[i].text).width;
+ ms.width += Math::ceil(font->get_string_size(tabs[i].text).width);
if (tabs[i].disabled)
ms.width += tab_disabled->get_minimum_size().width;
@@ -547,7 +547,7 @@ void Tabs::_update_cache() {
for (int i = 0; i < tabs.size(); i++) {
tabs.write[i].ofs_cache = mw;
tabs.write[i].size_cache = get_tab_width(i);
- tabs.write[i].size_text = font->get_string_size(tabs[i].text).width;
+ tabs.write[i].size_text = Math::ceil(font->get_string_size(tabs[i].text).width);
mw += tabs[i].size_cache;
if (tabs[i].size_cache <= min_width || i == current) {
size_fixed += tabs[i].size_cache;
@@ -803,7 +803,7 @@ int Tabs::get_tab_width(int p_idx) const {
x += get_constant("hseparation");
}
- x += font->get_string_size(tabs[p_idx].text).width;
+ x += Math::ceil(font->get_string_size(tabs[p_idx].text).width);
if (tabs[p_idx].disabled)
x += tab_disabled->get_minimum_size().width;