summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/classes/String.xml19
-rw-r--r--editor/plugins/tile_map_editor_plugin.cpp1
-rw-r--r--editor/spatial_editor_gizmos.cpp6
3 files changed, 18 insertions, 8 deletions
diff --git a/doc/classes/String.xml b/doc/classes/String.xml
index e0a4a24299..11a9f6dc0d 100644
--- a/doc/classes/String.xml
+++ b/doc/classes/String.xml
@@ -744,7 +744,15 @@
Splits the string by a [code]delimiter[/code] string and returns an array of the substrings, starting from right.
The splits in the returned array are sorted in the same order as the original string, from left to right.
If [code]maxsplit[/code] is specified, it defines the number of splits to do from the right up to [code]maxsplit[/code]. The default value of 0 means that all items are split, thus giving the same result as [method split].
- For example, [code]"One,Two,Three,Four"[/code] will return [code]["Three","Four"][/code] if split by [code]","[/code] with a [code]maxsplit[/code] value of 2.
+ Example:
+ [codeblock]
+ var some_string = "One,Two,Three,Four"
+ var some_array = some_string.rsplit(",", true, 1)
+ print(some_array.size()) # Prints 2
+ print(some_array[0]) # Prints "Four"
+ print(some_array[1]) # Prints "Three,Two,One"
+ [/codeblock]
+
</description>
</method>
<method name="rstrip">
@@ -805,7 +813,14 @@
<description>
Splits the string by a [code]delimiter[/code] string and returns an array of the substrings.
If [code]maxsplit[/code] is specified, it defines the number of splits to do from the left up to [code]maxsplit[/code]. The default value of 0 means that all items are split.
- For example, [code]"One,Two,Three"[/code] will return [code]["One","Two"][/code] if split by [code]","[/code] with a [code]maxsplit[/code] value of 2.
+ Example:
+ [codeblock]
+ var some_string = "One,Two,Three,Four"
+ var some_array = some_string.split(",", true, 1)
+ print(some_array.size()) # Prints 2
+ print(some_array[0]) # Prints "One"
+ print(some_array[1]) # Prints "Two,Three,Four"
+ [/codeblock]
</description>
</method>
<method name="split_floats">
diff --git a/editor/plugins/tile_map_editor_plugin.cpp b/editor/plugins/tile_map_editor_plugin.cpp
index 10567557d6..385ba4cfda 100644
--- a/editor/plugins/tile_map_editor_plugin.cpp
+++ b/editor/plugins/tile_map_editor_plugin.cpp
@@ -515,6 +515,7 @@ void TileMapEditor::_update_palette() {
sel_tile = selected.get(Math::rand() % selected.size());
} else if (palette->get_item_count() > 0) {
palette->select(0);
+ sel_tile = palette->get_selected_items().get(0);
}
if (sel_tile != TileMap::INVALID_CELL && ((manual_autotile && tileset->tile_get_tile_mode(sel_tile) == TileSet::AUTO_TILE) || (!priority_atlastile && tileset->tile_get_tile_mode(sel_tile) == TileSet::ATLAS_TILE))) {
diff --git a/editor/spatial_editor_gizmos.cpp b/editor/spatial_editor_gizmos.cpp
index 16da2771b9..cfd9ec19d2 100644
--- a/editor/spatial_editor_gizmos.cpp
+++ b/editor/spatial_editor_gizmos.cpp
@@ -490,7 +490,6 @@ bool EditorSpatialGizmo::intersect_ray(Camera *p_camera, const Point2 &p_point,
if (r_gizmo_handle && !hidden) {
Transform t = spatial_node->get_global_transform();
- t.orthonormalize();
if (billboard_handle) {
t.set_look_at(t.origin, t.origin - p_camera->get_transform().basis.get_axis(2), p_camera->get_transform().basis.get_axis(1));
}
@@ -551,7 +550,6 @@ bool EditorSpatialGizmo::intersect_ray(Camera *p_camera, const Point2 &p_point,
if (selectable_icon_size > 0.0f) {
Transform t = spatial_node->get_global_transform();
- t.orthonormalize();
Vector3 camera_position = p_camera->get_camera_transform().origin;
if (camera_position.distance_squared_to(t.origin) > 0.01) {
t.set_look_at(t.origin, camera_position, Vector3(0, 1, 0));
@@ -861,7 +859,6 @@ void LightSpatialGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, int p_idx,
Light *light = Object::cast_to<Light>(p_gizmo->get_spatial_node());
Transform gt = light->get_global_transform();
- gt.orthonormalize();
Transform gi = gt.affine_inverse();
Vector3 ray_from = p_camera->project_ray_origin(p_point);
@@ -1106,7 +1103,6 @@ void AudioStreamPlayer3DSpatialGizmoPlugin::set_handle(EditorSpatialGizmo *p_giz
AudioStreamPlayer3D *player = Object::cast_to<AudioStreamPlayer3D>(p_gizmo->get_spatial_node());
Transform gt = player->get_global_transform();
- gt.orthonormalize();
Transform gi = gt.affine_inverse();
Vector3 ray_from = p_camera->project_ray_origin(p_point);
@@ -1266,7 +1262,6 @@ void CameraSpatialGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, int p_idx
Camera *camera = Object::cast_to<Camera>(p_gizmo->get_spatial_node());
Transform gt = camera->get_global_transform();
- gt.orthonormalize();
Transform gi = gt.affine_inverse();
Vector3 ray_from = p_camera->project_ray_origin(p_point);
@@ -3234,7 +3229,6 @@ void CollisionShapeSpatialGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, i
return;
Transform gt = cs->get_global_transform();
- gt.orthonormalize();
Transform gi = gt.affine_inverse();
Vector3 ray_from = p_camera->project_ray_origin(p_point);