diff options
-rw-r--r-- | drivers/gles2/rasterizer_canvas_gles2.h | 2 | ||||
-rw-r--r-- | editor/plugins/spatial_editor_plugin.cpp | 10 | ||||
-rw-r--r-- | editor/plugins/tile_map_editor_plugin.cpp | 8 | ||||
-rw-r--r-- | editor/plugins/tile_set_editor_plugin.cpp | 19 | ||||
-rw-r--r-- | modules/gdscript/gdscript_parser.cpp | 1 | ||||
-rw-r--r-- | scene/gui/rich_text_label.cpp | 6 |
6 files changed, 27 insertions, 19 deletions
diff --git a/drivers/gles2/rasterizer_canvas_gles2.h b/drivers/gles2/rasterizer_canvas_gles2.h index af41e91e0c..ab636dca71 100644 --- a/drivers/gles2/rasterizer_canvas_gles2.h +++ b/drivers/gles2/rasterizer_canvas_gles2.h @@ -84,7 +84,7 @@ public: Transform2D skeleton_transform; Transform2D skeleton_transform_inverse; - Vector2i skeleton_texture_size; + Size2i skeleton_texture_size; RID current_tex; RID current_normal; diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp index 6af6d48618..d2b1cfc5af 100644 --- a/editor/plugins/spatial_editor_plugin.cpp +++ b/editor/plugins/spatial_editor_plugin.cpp @@ -2922,8 +2922,14 @@ void SpatialEditorViewport::update_transform_gizmo_view() { if (dd == 0) dd = 0.0001; - float gsize = EditorSettings::get_singleton()->get("editors/3d/manipulator_gizmo_size"); - gizmo_scale = (gsize / Math::abs(dd)) * MAX(1, EDSCALE) / viewport_container->get_stretch_shrink(); + float gizmo_size = EditorSettings::get_singleton()->get("editors/3d/manipulator_gizmo_size"); + // At low viewport heights, multiply the gizmo scale based on the viewport height. + // This prevents the gizmo from growing very large and going outside the viewport. + const int viewport_base_height = 400 * MAX(1, EDSCALE); + gizmo_scale = + (gizmo_size / Math::abs(dd)) * MAX(1, EDSCALE) * + MIN(viewport_base_height, viewport_container->get_size().height) / viewport_base_height / + viewport_container->get_stretch_shrink(); Vector3 scale = Vector3(1, 1, 1) * gizmo_scale; xform.basis.scale(scale); diff --git a/editor/plugins/tile_map_editor_plugin.cpp b/editor/plugins/tile_map_editor_plugin.cpp index 766890242f..b2f06ca41f 100644 --- a/editor/plugins/tile_map_editor_plugin.cpp +++ b/editor/plugins/tile_map_editor_plugin.cpp @@ -521,7 +521,13 @@ void TileMapEditor::_update_palette() { for (const Map<Vector2, uint32_t>::Element *E = tiles2.front(); E; E = E->next()) { entries2.push_back(E->key()); } - entries2.sort(); + // Sort tiles in row-major order + struct SwapComparator { + _FORCE_INLINE_ bool operator()(const Vector2 &v_l, const Vector2 &v_r) const { + return v_l.y != v_r.y ? v_l.y < v_r.y : v_l.x < v_r.x; + } + }; + entries2.sort_custom<SwapComparator>(); Ref<Texture> tex = tileset->tile_get_texture(sel_tile); diff --git a/editor/plugins/tile_set_editor_plugin.cpp b/editor/plugins/tile_set_editor_plugin.cpp index f135becf5f..4942a2320b 100644 --- a/editor/plugins/tile_set_editor_plugin.cpp +++ b/editor/plugins/tile_set_editor_plugin.cpp @@ -924,8 +924,7 @@ void TileSetEditor::_on_workspace_draw() { case EDITMODE_OCCLUSION: case EDITMODE_NAVIGATION: { if (tileset->tile_get_tile_mode(get_current_tile()) == TileSet::AUTO_TILE || tileset->tile_get_tile_mode(get_current_tile()) == TileSet::ATLAS_TILE) { - Vector2 coord = edited_shape_coord; - draw_highlight_subtile(coord); + draw_highlight_subtile(edited_shape_coord); } draw_polygon_shapes(); draw_grid_snap(); @@ -1872,7 +1871,7 @@ void TileSetEditor::_update_tile_data() { } else { int spacing = tileset->autotile_get_spacing(get_current_tile()); Vector2 size = tileset->tile_get_region(get_current_tile()).size; - Vector2i cell_count = size / (tileset->autotile_get_size(get_current_tile()) + Vector2(spacing, spacing)); + Vector2 cell_count = (size / (tileset->autotile_get_size(get_current_tile()) + Vector2(spacing, spacing))).floor(); for (int y = 0; y < cell_count.y; y++) { for (int x = 0; x < cell_count.x; x++) { SubtileData data; @@ -1974,7 +1973,7 @@ void TileSetEditor::_select_previous_tile() { case EDITMODE_Z_INDEX: { int spacing = tileset->autotile_get_spacing(get_current_tile()); Vector2 size = tileset->tile_get_region(get_current_tile()).size; - Vector2i cell_count = size / (tileset->autotile_get_size(get_current_tile()) + Vector2(spacing, spacing)); + Vector2 cell_count = (size / (tileset->autotile_get_size(get_current_tile()) + Vector2(spacing, spacing))).floor(); cell_count -= Vector2(1, 1); edited_shape_coord = cell_count; _select_edited_shape_coord(); @@ -2031,7 +2030,7 @@ void TileSetEditor::_select_next_subtile() { } else { int spacing = tileset->autotile_get_spacing(get_current_tile()); Vector2 size = tileset->tile_get_region(get_current_tile()).size; - Vector2i cell_count = size / (tileset->autotile_get_size(get_current_tile()) + Vector2(spacing, spacing)); + Vector2 cell_count = (size / (tileset->autotile_get_size(get_current_tile()) + Vector2(spacing, spacing))).floor(); if (edited_shape_coord.x >= cell_count.x - 1 && edited_shape_coord.y >= cell_count.y - 1) { _select_next_tile(); } else { @@ -2057,7 +2056,7 @@ void TileSetEditor::_select_previous_subtile() { } else { int spacing = tileset->autotile_get_spacing(get_current_tile()); Vector2 size = tileset->tile_get_region(get_current_tile()).size; - Vector2i cell_count = size / (tileset->autotile_get_size(get_current_tile()) + Vector2(spacing, spacing)); + Vector2 cell_count = (size / (tileset->autotile_get_size(get_current_tile()) + Vector2(spacing, spacing))).floor(); if (edited_shape_coord.x <= 0 && edited_shape_coord.y <= 0) { _select_previous_tile(); } else { @@ -2077,9 +2076,9 @@ void TileSetEditor::_select_next_shape() { } else if (edit_mode != EDITMODE_COLLISION) { _select_next_subtile(); } else { - Vector2i edited_coord = Vector2(); + Vector2i edited_coord = Vector2i(); if (tileset->tile_get_tile_mode(get_current_tile()) != TileSet::SINGLE_TILE) { - edited_coord = edited_shape_coord; + edited_coord = Vector2i(edited_shape_coord); } SubtileData data = current_tile_data[edited_coord]; if (data.collisions.size() == 0) { @@ -2130,9 +2129,9 @@ void TileSetEditor::_select_previous_shape() { } else if (edit_mode != EDITMODE_COLLISION) { _select_previous_subtile(); } else { - Vector2i edited_coord = Vector2(); + Vector2i edited_coord = Vector2i(); if (tileset->tile_get_tile_mode(get_current_tile()) != TileSet::SINGLE_TILE) { - edited_coord = edited_shape_coord; + edited_coord = Vector2i(edited_shape_coord); } SubtileData data = current_tile_data[edited_coord]; if (data.collisions.size() == 0) { diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index f006d50a83..357e9c9615 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -3487,6 +3487,7 @@ void GDScriptParser::_parse_class(ClassNode *p_class) { } break; case GDScriptTokenizer::TK_PR_CLASS_NAME: { + _mark_line_as_safe(tokenizer->get_token_line()); if (p_class->owner) { _set_error("'class_name' is only valid for the main class namespace."); return; diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp index d6c0981ebc..8223ea6d1e 100644 --- a/scene/gui/rich_text_label.cpp +++ b/scene/gui/rich_text_label.cpp @@ -821,11 +821,7 @@ void RichTextLabel::_notification(int p_what) { } break; case NOTIFICATION_THEME_CHANGED: { - if (is_inside_tree() && use_bbcode) { - parse_bbcode(bbcode); - //first_invalid_line=0; //invalidate ALL - //update(); - } + update(); } break; case NOTIFICATION_DRAW: { |