From 73d587f82c0a2b3466191180898ba3d7dc56b1a6 Mon Sep 17 00:00:00 2001 From: Leroy Hopson Date: Thu, 8 Jul 2021 20:39:32 +0700 Subject: [PATCH] Reformat code causing clang-format clashes VSCode and the clang-format git hook disagreed about how this one should be formatted, so it kept changing. --- addons/godot_xterm/native/src/terminal.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/addons/godot_xterm/native/src/terminal.cpp b/addons/godot_xterm/native/src/terminal.cpp index 7bc0f5a..65ee90e 100644 --- a/addons/godot_xterm/native/src/terminal.cpp +++ b/addons/godot_xterm/native/src/terminal.cpp @@ -554,10 +554,14 @@ void Terminal::update_size() { // Recalculates the cell_size and number of cols/rows based on font size and // the Control's rect_size. - Ref fontref = fontmap.count("Regular") ? fontmap["Regular"] - : has_font("Regular", "Terminal") - ? get_font("Regular", "Terminal") - : get_font(""); + Ref fontref; + if (fontmap.count("Regular")) + fontref = fontmap["Regular"]; + else if (has_font("Regular", "Terminal")) + fontref = get_font("Regular", "Terminal"); + else + fontref = get_font(""); + cell_size = fontref->get_string_size("W"); rows = std::max(2, (int)floor(get_rect().size.y / cell_size.y));