Merge pull request #7878 from RebelliousX/else

Bunch of missing `else` statements and general logic
This commit is contained in:
Rémi Verschelde
2017-02-28 23:03:10 +01:00
committed by GitHub
32 changed files with 41 additions and 39 deletions
+1
View File
@@ -229,6 +229,7 @@ ParticleAttractor2D::ParticleAttractor2D() {
/****************************************/
_FORCE_INLINE_ static float _rand_from_seed(uint64_t *seed) {
uint32_t r = Math::rand_from_seed(seed);
return 2.0f * (float)r / (float)Math::RANDOM_MAX - 1.0f;
}
-2
View File
@@ -2421,8 +2421,6 @@ void Control::get_argument_options(const StringName& p_function,int p_idx,List<S
Theme::get_default()->get_font_list(get_class(),&sn);
} else if (pf=="add_constant_override" || pf=="has_constant" || pf=="has_constant_override" || pf=="get_constant") {
Theme::get_default()->get_constant_list(get_class(),&sn);
} else if (pf=="add_color_override" || pf=="has_color" || pf=="has_color_override" || pf=="get_color") {
Theme::get_default()->get_color_list(get_class(),&sn);
}
sn.sort_custom<StringName::AlphCompare>();
+1 -1
View File
@@ -201,7 +201,7 @@ void AcceptDialog::_notification(int p_what) {
if (p_what==NOTIFICATION_MODAL_CLOSE) {
cancel_pressed();
} if (p_what==NOTIFICATION_RESIZED) {
} else if (p_what==NOTIFICATION_RESIZED) {
_update_child_rects();
}
+1 -1
View File
@@ -314,7 +314,7 @@ void ItemList::move_item(int p_item,int p_to_pos) {
if (current<0) {
//do none
} if (p_item==current) {
} else if (p_item==current) {
current=p_to_pos;
} else if (p_to_pos>p_item && current>p_item && current<p_to_pos) {
current--;
+1 -1
View File
@@ -173,7 +173,7 @@ private:
struct ItemNewline : public Item {
int line;
int line; // FIXME: Overriding base's line ?
ItemNewline() { type=ITEM_NEWLINE; }
};
+1 -1
View File
@@ -4267,7 +4267,7 @@ void TextEdit::_update_completion_candidates() {
//no completion here
//print_line("cancel!");
cancel=true;
} if (inquote && first_quote!=-1) {
} else if (inquote && first_quote!=-1) {
s=l.substr(first_quote,cofs-first_quote);
//print_line("s: 1"+s);
@@ -986,7 +986,7 @@ void make_default_theme(bool p_hidpi,Ref<Font> p_font) {
Ref<BitmapFont> default_font;
if (p_font.is_valid()) {
default_font=p_font;
} if (p_hidpi) {
} else if (p_hidpi) {
default_font=make_font2(_hidpi_font_height,_hidpi_font_ascent,_hidpi_font_charcount,&_hidpi_font_charrects[0][0],_hidpi_font_kerning_pair_count,&_hidpi_font_kerning_pairs[0][0],_hidpi_font_img_width,_hidpi_font_img_height,_hidpi_font_img_data);
} else {
default_font=make_font2(_lodpi_font_height,_lodpi_font_ascent,_lodpi_font_charcount,&_lodpi_font_charrects[0][0],_lodpi_font_kerning_pair_count,&_lodpi_font_kerning_pairs[0][0],_lodpi_font_img_width,_lodpi_font_img_height,_lodpi_font_img_data);