1
0
mirror of https://github.com/godotengine/godot.git synced 2026-01-06 19:41:11 +00:00

clang-format: Disable alignment of operands, too unreliable

Sets `AlignOperands` to `DontAlign`.

`clang-format` developers seem to mostly care about space-based indentation and
every other version of clang-format breaks the bad mismatch of tabs and spaces
that it seems to use for operand alignment. So it's better without, so that it
respects our two-tabs `ContinuationIndentWidth`.
This commit is contained in:
Rémi Verschelde
2021-10-28 13:23:24 +02:00
parent c7f4e1d5dd
commit 42d385b312
96 changed files with 519 additions and 540 deletions

View File

@@ -70,8 +70,8 @@ Dictionary Control::_edit_get_state() const {
void Control::_edit_set_state(const Dictionary &p_state) {
ERR_FAIL_COND((p_state.size() <= 0) ||
!p_state.has("rotation") || !p_state.has("scale") ||
!p_state.has("pivot") || !p_state.has("anchors") || !p_state.has("margins"));
!p_state.has("rotation") || !p_state.has("scale") ||
!p_state.has("pivot") || !p_state.has("anchors") || !p_state.has("margins"));
Dictionary state = p_state;
set_rotation(state["rotation"]);

View File

@@ -306,7 +306,7 @@ bool FileDialog::_is_open_should_be_disabled() {
// Opening a file, but selected a folder? Forbidden.
return ((mode == MODE_OPEN_FILE || mode == MODE_OPEN_FILES) && d["dir"]) || // Flipped case, also forbidden.
(mode == MODE_OPEN_DIR && !d["dir"]);
(mode == MODE_OPEN_DIR && !d["dir"]);
}
void FileDialog::_go_up() {

View File

@@ -401,13 +401,13 @@ void Label::regenerate_word_cache() {
// if your language is not well supported, consider helping improve
// the unicode support in Godot.
bool separatable = (current >= 0x2E08 && current <= 0x9FFF) || // CJK scripts and symbols.
(current >= 0xAC00 && current <= 0xD7FF) || // Hangul Syllables and Hangul Jamo Extended-B.
(current >= 0xF900 && current <= 0xFAFF) || // CJK Compatibility Ideographs.
(current >= 0xFE30 && current <= 0xFE4F) || // CJK Compatibility Forms.
(current >= 0xFF65 && current <= 0xFF9F) || // Halfwidth forms of katakana
(current >= 0xFFA0 && current <= 0xFFDC) || // Halfwidth forms of compatibility jamo characters for Hangul
(current >= 0x20000 && current <= 0x2FA1F) || // CJK Unified Ideographs Extension B ~ F and CJK Compatibility Ideographs Supplement.
(current >= 0x30000 && current <= 0x3134F); // CJK Unified Ideographs Extension G.
(current >= 0xAC00 && current <= 0xD7FF) || // Hangul Syllables and Hangul Jamo Extended-B.
(current >= 0xF900 && current <= 0xFAFF) || // CJK Compatibility Ideographs.
(current >= 0xFE30 && current <= 0xFE4F) || // CJK Compatibility Forms.
(current >= 0xFF65 && current <= 0xFF9F) || // Halfwidth forms of katakana
(current >= 0xFFA0 && current <= 0xFFDC) || // Halfwidth forms of compatibility jamo characters for Hangul
(current >= 0x20000 && current <= 0x2FA1F) || // CJK Unified Ideographs Extension B ~ F and CJK Compatibility Ideographs Supplement.
(current >= 0x30000 && current <= 0x3134F); // CJK Unified Ideographs Extension G.
bool insert_newline = false;
real_t char_width = 0;

View File

@@ -420,13 +420,13 @@ int RichTextLabel::_process_line(ItemFrame *p_frame, const Vector2 &p_ofs, int &
// For info about the unicode range, see Label::regenerate_word_cache.
const CharType current = c[end];
const bool separatable = (current >= 0x2E08 && current <= 0x9FFF) || // CJK scripts and symbols.
(current >= 0xAC00 && current <= 0xD7FF) || // Hangul Syllables and Hangul Jamo Extended-B.
(current >= 0xF900 && current <= 0xFAFF) || // CJK Compatibility Ideographs.
(current >= 0xFE30 && current <= 0xFE4F) || // CJK Compatibility Forms.
(current >= 0xFF65 && current <= 0xFF9F) || // Halfwidth forms of katakana
(current >= 0xFFA0 && current <= 0xFFDC) || // Halfwidth forms of compatibility jamo characters for Hangul
(current >= 0x20000 && current <= 0x2FA1F) || // CJK Unified Ideographs Extension B ~ F and CJK Compatibility Ideographs Supplement.
(current >= 0x30000 && current <= 0x3134F); // CJK Unified Ideographs Extension G.
(current >= 0xAC00 && current <= 0xD7FF) || // Hangul Syllables and Hangul Jamo Extended-B.
(current >= 0xF900 && current <= 0xFAFF) || // CJK Compatibility Ideographs.
(current >= 0xFE30 && current <= 0xFE4F) || // CJK Compatibility Forms.
(current >= 0xFF65 && current <= 0xFF9F) || // Halfwidth forms of katakana
(current >= 0xFFA0 && current <= 0xFFDC) || // Halfwidth forms of compatibility jamo characters for Hangul
(current >= 0x20000 && current <= 0x2FA1F) || // CJK Unified Ideographs Extension B ~ F and CJK Compatibility Ideographs Supplement.
(current >= 0x30000 && current <= 0x3134F); // CJK Unified Ideographs Extension G.
const bool long_separatable = separatable && (wofs - backtrack + w + cw > p_width);
const bool separation_changed = end > 0 && was_separatable != separatable;
if (!just_breaked_in_middle && (long_separatable || separation_changed)) {
@@ -501,8 +501,7 @@ int RichTextLabel::_process_line(ItemFrame *p_frame, const Vector2 &p_ofs, int &
fx_color.a = faded_visibility;
}
bool visible = visible_characters < 0 || ((p_char_count < visible_characters && YRANGE_VISIBLE(y + lh - line_descent - line_ascent, line_ascent + line_descent)) &&
faded_visibility > 0.0f);
bool visible = visible_characters < 0 || ((p_char_count < visible_characters && YRANGE_VISIBLE(y + lh - line_descent - line_ascent, line_ascent + line_descent)) && faded_visibility > 0.0f);
const bool previously_visible = visible;
@@ -548,7 +547,7 @@ int RichTextLabel::_process_line(ItemFrame *p_frame, const Vector2 &p_ofs, int &
Math::lerp(Math::cos(previous_offset),
Math::cos(current_offset),
n_time)) *
(float)item_shake->strength / 10.0f;
(float)item_shake->strength / 10.0f;
} else if (item_fx->type == ITEM_WAVE) {
ItemWave *item_wave = static_cast<ItemWave *>(item_fx);

View File

@@ -241,12 +241,12 @@ private:
uint64_t offset_random(int index) {
return (_current_rng >> (index % 64)) |
(_current_rng << (64 - (index % 64)));
(_current_rng << (64 - (index % 64)));
}
uint64_t offset_previous_random(int index) {
return (_previous_rng >> (index % 64)) |
(_previous_rng << (64 - (index % 64)));
(_previous_rng << (64 - (index % 64)));
}
};

View File

@@ -70,18 +70,18 @@ static bool _is_hex_symbol(CharType c) {
static bool _is_pair_right_symbol(CharType c) {
return c == '"' ||
c == '\'' ||
c == ')' ||
c == ']' ||
c == '}';
c == '\'' ||
c == ')' ||
c == ']' ||
c == '}';
}
static bool _is_pair_left_symbol(CharType c) {
return c == '"' ||
c == '\'' ||
c == '(' ||
c == '[' ||
c == '{';
c == '\'' ||
c == '(' ||
c == '[' ||
c == '{';
}
static bool _is_pair_symbol(CharType c) {