summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
Diffstat (limited to 'scene')
-rw-r--r--scene/gui/text_edit.cpp14
-rw-r--r--scene/resources/mesh.cpp16
2 files changed, 19 insertions, 11 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index 5e925bf37f..784a6afc7b 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -1856,6 +1856,7 @@ void TextEdit::_consume_pair_symbol(CharType ch) {
bool in_single_quote = false;
bool in_double_quote = false;
+ bool found_comment = false;
int c = 0;
while (c < line.length()) {
@@ -1865,6 +1866,9 @@ void TextEdit::_consume_pair_symbol(CharType ch) {
if (cursor.column == c) {
break;
}
+ } else if (!in_single_quote && !in_double_quote && line[c] == '#') {
+ found_comment = true;
+ break;
} else {
if (line[c] == '\'' && !in_double_quote) {
in_single_quote = !in_single_quote;
@@ -1880,7 +1884,15 @@ void TextEdit::_consume_pair_symbol(CharType ch) {
}
}
- // Disallow inserting duplicated quotes while already in string
+ // Do not need to duplicate quotes while in comments
+ if (found_comment) {
+ insert_text_at_cursor(ch_single);
+ cursor_set_column(cursor_position_to_move);
+
+ return;
+ }
+
+ // Disallow inserting duplicated quotes while already in string
if ((in_single_quote || in_double_quote) && (ch == '"' || ch == '\'')) {
insert_text_at_cursor(ch_single);
cursor_set_column(cursor_position_to_move);
diff --git a/scene/resources/mesh.cpp b/scene/resources/mesh.cpp
index a063b7f74f..5e032c41bf 100644
--- a/scene/resources/mesh.cpp
+++ b/scene/resources/mesh.cpp
@@ -252,10 +252,12 @@ Ref<Shape> Mesh::create_trimesh_shape() const {
Vector<Vector3> face_points;
face_points.resize(faces.size() * 3);
- for (int i = 0; i < face_points.size(); i++) {
+ for (int i = 0; i < face_points.size(); i += 3) {
Face3 f = faces.get(i / 3);
- face_points.set(i, f.vertex[i % 3]);
+ face_points.set(i, f.vertex[0]);
+ face_points.set(i + 1, f.vertex[1]);
+ face_points.set(i + 2, f.vertex[2]);
}
Ref<ConcavePolygonShape> shape = memnew(ConcavePolygonShape);
@@ -543,15 +545,9 @@ Vector<Ref<Shape> > Mesh::convex_decompose() const {
ERR_FAIL_COND_V(!convex_composition_function, Vector<Ref<Shape> >());
- Vector<Face3> faces = get_faces();
- Vector<Face3> f3;
- f3.resize(faces.size());
- const Face3 *f = faces.ptr();
- for (int i = 0; i < f3.size(); i++) {
- f3.write[i] = f[i];
- }
+ const Vector<Face3> faces = get_faces();
- Vector<Vector<Face3> > decomposed = convex_composition_function(f3);
+ Vector<Vector<Face3> > decomposed = convex_composition_function(faces);
Vector<Ref<Shape> > ret;