summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
Diffstat (limited to 'scene')
-rw-r--r--scene/2d/touch_screen_button.cpp8
-rw-r--r--scene/gui/text_edit.cpp2
-rw-r--r--scene/resources/particles_material.cpp2
-rw-r--r--scene/resources/theme.cpp49
4 files changed, 39 insertions, 22 deletions
diff --git a/scene/2d/touch_screen_button.cpp b/scene/2d/touch_screen_button.cpp
index cf68528388..9a1a759e72 100644
--- a/scene/2d/touch_screen_button.cpp
+++ b/scene/2d/touch_screen_button.cpp
@@ -325,12 +325,8 @@ void TouchScreenButton::_release(bool p_exiting_tree) {
}
Rect2 TouchScreenButton::_edit_get_rect() const {
- if (texture.is_null()) {
- if (shape.is_valid())
- return shape->get_rect();
- else
- return CanvasItem::_edit_get_rect();
- }
+ if (texture.is_null())
+ return CanvasItem::_edit_get_rect();
return Rect2(Size2(), texture->get_size());
}
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index c818633f48..8ddc31745e 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -4585,7 +4585,7 @@ void TextEdit::_scroll_moved(double p_to_val) {
int v_scroll_i = floor(get_v_scroll());
int sc = 0;
int n_line;
- for (n_line = 0; n_line < text.size() - 1; n_line++) {
+ for (n_line = 0; n_line < text.size(); n_line++) {
if (!is_line_hidden(n_line)) {
sc++;
sc += times_line_wraps(n_line);
diff --git a/scene/resources/particles_material.cpp b/scene/resources/particles_material.cpp
index 969743f78c..c5956d9bc2 100644
--- a/scene/resources/particles_material.cpp
+++ b/scene/resources/particles_material.cpp
@@ -332,7 +332,7 @@ void ParticlesMaterial::_update_shader() {
code += " float base_angle = (initial_angle + tex_angle) * mix(1.0, angle_rand, initial_angle_random);\n";
code += " CUSTOM.x = base_angle * degree_to_rad;\n"; // angle
code += " CUSTOM.y = 0.0;\n"; // phase
- code += " CUSTOM.w = LIFETIME * (1.0 - lifetime_randomness * rand_from_seed(alt_seed));\n";
+ code += " CUSTOM.w = (1.0 - lifetime_randomness * rand_from_seed(alt_seed));\n";
code += " CUSTOM.z = (anim_offset + tex_anim_offset) * mix(1.0, anim_offset_rand, anim_offset_random);\n"; // animation offset (0-1)
switch (emission_shape) {
diff --git a/scene/resources/theme.cpp b/scene/resources/theme.cpp
index f1429a7d7b..c897365b21 100644
--- a/scene/resources/theme.cpp
+++ b/scene/resources/theme.cpp
@@ -44,8 +44,11 @@ PoolVector<String> Theme::_get_icon_list(const String &p_type) const {
get_icon_list(p_type, &il);
ilret.resize(il.size());
- for (List<StringName>::Element *E = il.front(); E; E = E->next()) {
- ilret.push_back(E->get());
+
+ int i = 0;
+ PoolVector<String>::Write w = ilret.write();
+ for (List<StringName>::Element *E = il.front(); E; E = E->next(), i++) {
+ w[i] = E->get();
}
return ilret;
}
@@ -57,8 +60,11 @@ PoolVector<String> Theme::_get_stylebox_list(const String &p_type) const {
get_stylebox_list(p_type, &il);
ilret.resize(il.size());
- for (List<StringName>::Element *E = il.front(); E; E = E->next()) {
- ilret.push_back(E->get());
+
+ int i = 0;
+ PoolVector<String>::Write w = ilret.write();
+ for (List<StringName>::Element *E = il.front(); E; E = E->next(), i++) {
+ w[i] = E->get();
}
return ilret;
}
@@ -70,8 +76,11 @@ PoolVector<String> Theme::_get_stylebox_types(void) const {
get_stylebox_types(&il);
ilret.resize(il.size());
- for (List<StringName>::Element *E = il.front(); E; E = E->next()) {
- ilret.push_back(E->get());
+
+ int i = 0;
+ PoolVector<String>::Write w = ilret.write();
+ for (List<StringName>::Element *E = il.front(); E; E = E->next(), i++) {
+ w[i] = E->get();
}
return ilret;
}
@@ -83,8 +92,11 @@ PoolVector<String> Theme::_get_font_list(const String &p_type) const {
get_font_list(p_type, &il);
ilret.resize(il.size());
- for (List<StringName>::Element *E = il.front(); E; E = E->next()) {
- ilret.push_back(E->get());
+
+ int i = 0;
+ PoolVector<String>::Write w = ilret.write();
+ for (List<StringName>::Element *E = il.front(); E; E = E->next(), i++) {
+ w[i] = E->get();
}
return ilret;
}
@@ -96,8 +108,11 @@ PoolVector<String> Theme::_get_color_list(const String &p_type) const {
get_color_list(p_type, &il);
ilret.resize(il.size());
- for (List<StringName>::Element *E = il.front(); E; E = E->next()) {
- ilret.push_back(E->get());
+
+ int i = 0;
+ PoolVector<String>::Write w = ilret.write();
+ for (List<StringName>::Element *E = il.front(); E; E = E->next(), i++) {
+ w[i] = E->get();
}
return ilret;
}
@@ -109,8 +124,11 @@ PoolVector<String> Theme::_get_constant_list(const String &p_type) const {
get_constant_list(p_type, &il);
ilret.resize(il.size());
- for (List<StringName>::Element *E = il.front(); E; E = E->next()) {
- ilret.push_back(E->get());
+
+ int i = 0;
+ PoolVector<String>::Write w = ilret.write();
+ for (List<StringName>::Element *E = il.front(); E; E = E->next(), i++) {
+ w[i] = E->get();
}
return ilret;
}
@@ -122,8 +140,11 @@ PoolVector<String> Theme::_get_type_list(const String &p_type) const {
get_type_list(&il);
ilret.resize(il.size());
- for (List<StringName>::Element *E = il.front(); E; E = E->next()) {
- ilret.push_back(E->get());
+
+ int i = 0;
+ PoolVector<String>::Write w = ilret.write();
+ for (List<StringName>::Element *E = il.front(); E; E = E->next(), i++) {
+ w[i] = E->get();
}
return ilret;
}