Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks
Which means that reduz' beloved style which we all became used to will now be changed automatically to remove the first empty line. This makes us lean closer to 1TBS (the one true brace style) instead of hybridating it with some Allman-inspired spacing. There's still the case of braces around single-statement blocks that needs to be addressed (but clang-format can't help with that, but clang-tidy may if we agree about it). Part of #33027.
This commit is contained in:
@@ -45,13 +45,11 @@ static float scale = 1;
|
||||
|
||||
template <class T>
|
||||
static Ref<StyleBoxTexture> make_stylebox(T p_src, float p_left, float p_top, float p_right, float p_botton, float p_margin_left = -1, float p_margin_top = -1, float p_margin_right = -1, float p_margin_botton = -1, bool p_draw_center = true) {
|
||||
|
||||
Ref<ImageTexture> texture;
|
||||
|
||||
if (tex_cache->has(p_src)) {
|
||||
texture = (*tex_cache)[p_src];
|
||||
} else {
|
||||
|
||||
texture = Ref<ImageTexture>(memnew(ImageTexture));
|
||||
Ref<Image> img = memnew(Image(p_src));
|
||||
|
||||
@@ -89,7 +87,6 @@ static Ref<StyleBoxTexture> make_stylebox(T p_src, float p_left, float p_top, fl
|
||||
}
|
||||
|
||||
static Ref<StyleBoxTexture> sb_expand(Ref<StyleBoxTexture> p_sbox, float p_left, float p_top, float p_right, float p_botton) {
|
||||
|
||||
p_sbox->set_expand_margin_size(MARGIN_LEFT, p_left * scale);
|
||||
p_sbox->set_expand_margin_size(MARGIN_TOP, p_top * scale);
|
||||
p_sbox->set_expand_margin_size(MARGIN_RIGHT, p_right * scale);
|
||||
@@ -99,7 +96,6 @@ static Ref<StyleBoxTexture> sb_expand(Ref<StyleBoxTexture> p_sbox, float p_left,
|
||||
|
||||
template <class T>
|
||||
static Ref<Texture2D> make_icon(T p_src) {
|
||||
|
||||
Ref<ImageTexture> texture(memnew(ImageTexture));
|
||||
Ref<Image> img = memnew(Image(p_src));
|
||||
if (scale > 1) {
|
||||
@@ -121,7 +117,6 @@ static Ref<Texture2D> make_icon(T p_src) {
|
||||
}
|
||||
|
||||
static Ref<BitmapFont> make_font(int p_height, int p_ascent, int p_charcount, const int *p_char_rects, int p_kerning_count, const int *p_kernings, int p_w, int p_h, const unsigned char *p_img) {
|
||||
|
||||
Ref<BitmapFont> font(memnew(BitmapFont));
|
||||
|
||||
Ref<Image> image = memnew(Image(p_img));
|
||||
@@ -131,7 +126,6 @@ static Ref<BitmapFont> make_font(int p_height, int p_ascent, int p_charcount, co
|
||||
font->add_texture(tex);
|
||||
|
||||
for (int i = 0; i < p_charcount; i++) {
|
||||
|
||||
const int *c = &p_char_rects[i * 8];
|
||||
|
||||
int chr = c[0];
|
||||
@@ -147,7 +141,6 @@ static Ref<BitmapFont> make_font(int p_height, int p_ascent, int p_charcount, co
|
||||
}
|
||||
|
||||
for (int i = 0; i < p_kerning_count; i++) {
|
||||
|
||||
font->add_kerning_pair(p_kernings[i * 3 + 0], p_kernings[i * 3 + 1], p_kernings[i * 3 + 2]);
|
||||
}
|
||||
|
||||
@@ -158,7 +151,6 @@ static Ref<BitmapFont> make_font(int p_height, int p_ascent, int p_charcount, co
|
||||
}
|
||||
|
||||
static Ref<StyleBox> make_empty_stylebox(float p_margin_left = -1, float p_margin_top = -1, float p_margin_right = -1, float p_margin_botton = -1) {
|
||||
|
||||
Ref<StyleBox> style(memnew(StyleBoxEmpty));
|
||||
|
||||
style->set_default_margin(MARGIN_LEFT, p_margin_left * scale);
|
||||
@@ -170,7 +162,6 @@ static Ref<StyleBox> make_empty_stylebox(float p_margin_left = -1, float p_margi
|
||||
}
|
||||
|
||||
void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const Ref<Font> &large_font, Ref<Texture2D> &default_icon, Ref<StyleBox> &default_style, float p_scale) {
|
||||
|
||||
scale = p_scale;
|
||||
|
||||
tex_cache = memnew(TexCacheMap);
|
||||
@@ -867,7 +858,6 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
|
||||
}
|
||||
|
||||
void make_default_theme(bool p_hidpi, Ref<Font> p_font) {
|
||||
|
||||
Ref<Theme> t;
|
||||
t.instance();
|
||||
|
||||
@@ -891,7 +881,6 @@ void make_default_theme(bool p_hidpi, Ref<Font> p_font) {
|
||||
}
|
||||
|
||||
void clear_default_theme() {
|
||||
|
||||
Theme::set_project_default(nullptr);
|
||||
Theme::set_default(nullptr);
|
||||
Theme::set_default_icon(nullptr);
|
||||
|
||||
Reference in New Issue
Block a user