summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/gdscript/editor/gdscript_highlighter.cpp2
-rw-r--r--modules/gdscript/gdscript.cpp2
-rw-r--r--modules/gltf/editor/editor_scene_importer_blend.cpp4
-rw-r--r--modules/interactive_music/editor/audio_stream_interactive_editor_plugin.cpp2
-rw-r--r--modules/multiplayer/editor/editor_network_profiler.cpp4
-rw-r--r--modules/navigation/nav_map.cpp30
-rw-r--r--modules/text_server_adv/text_server_adv.cpp27
7 files changed, 39 insertions, 32 deletions
diff --git a/modules/gdscript/editor/gdscript_highlighter.cpp b/modules/gdscript/editor/gdscript_highlighter.cpp
index f83b784f85..eecce70202 100644
--- a/modules/gdscript/editor/gdscript_highlighter.cpp
+++ b/modules/gdscript/editor/gdscript_highlighter.cpp
@@ -690,7 +690,7 @@ void GDScriptSyntaxHighlighter::_update_cache() {
color_regions.clear();
color_region_cache.clear();
- font_color = text_edit->get_theme_color(SNAME("font_color"));
+ font_color = text_edit->get_theme_color(SceneStringName(font_color));
symbol_color = EDITOR_GET("text_editor/theme/highlighting/symbol_color");
function_color = EDITOR_GET("text_editor/theme/highlighting/function_color");
number_color = EDITOR_GET("text_editor/theme/highlighting/number_color");
diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp
index 838ab42beb..20d424894a 100644
--- a/modules/gdscript/gdscript.cpp
+++ b/modules/gdscript/gdscript.cpp
@@ -995,7 +995,7 @@ bool GDScript::_get(const StringName &p_name, Variant &r_ret) const {
bool GDScript::_set(const StringName &p_name, const Variant &p_value) {
if (p_name == GDScriptLanguage::get_singleton()->strings._script_source) {
set_source_code(p_value);
- reload();
+ reload(true);
return true;
}
diff --git a/modules/gltf/editor/editor_scene_importer_blend.cpp b/modules/gltf/editor/editor_scene_importer_blend.cpp
index 822e11ea4b..4ad00c719b 100644
--- a/modules/gltf/editor/editor_scene_importer_blend.cpp
+++ b/modules/gltf/editor/editor_scene_importer_blend.cpp
@@ -395,10 +395,10 @@ void EditorFileSystemImportFormatSupportQueryBlend::_validate_path(String p_path
path_status->set_text(error);
if (success) {
- path_status->add_theme_color_override("font_color", path_status->get_theme_color(SNAME("success_color"), EditorStringName(Editor)));
+ path_status->add_theme_color_override(SceneStringName(font_color), path_status->get_theme_color(SNAME("success_color"), EditorStringName(Editor)));
configure_blender_dialog->get_ok_button()->set_disabled(false);
} else {
- path_status->add_theme_color_override("font_color", path_status->get_theme_color(SNAME("error_color"), EditorStringName(Editor)));
+ path_status->add_theme_color_override(SceneStringName(font_color), path_status->get_theme_color(SNAME("error_color"), EditorStringName(Editor)));
configure_blender_dialog->get_ok_button()->set_disabled(true);
}
}
diff --git a/modules/interactive_music/editor/audio_stream_interactive_editor_plugin.cpp b/modules/interactive_music/editor/audio_stream_interactive_editor_plugin.cpp
index cd3814879a..28b875a4ad 100644
--- a/modules/interactive_music/editor/audio_stream_interactive_editor_plugin.cpp
+++ b/modules/interactive_music/editor/audio_stream_interactive_editor_plugin.cpp
@@ -161,7 +161,7 @@ void AudioStreamInteractiveTransitionEditor::_update_transitions() {
return;
}
int clip_count = audio_stream_interactive->get_clip_count();
- Color font_color = tree->get_theme_color("font_color", "Tree");
+ Color font_color = tree->get_theme_color(SceneStringName(font_color), "Tree");
Color font_color_default = font_color;
font_color_default.a *= 0.5;
Ref<Texture> fade_icons[5] = {
diff --git a/modules/multiplayer/editor/editor_network_profiler.cpp b/modules/multiplayer/editor/editor_network_profiler.cpp
index 75941207c7..d5d4b465d8 100644
--- a/modules/multiplayer/editor/editor_network_profiler.cpp
+++ b/modules/multiplayer/editor/editor_network_profiler.cpp
@@ -74,8 +74,8 @@ void EditorNetworkProfiler::_update_theme_item_cache() {
theme_cache.incoming_bandwidth_icon = get_theme_icon(SNAME("ArrowDown"), EditorStringName(EditorIcons));
theme_cache.outgoing_bandwidth_icon = get_theme_icon(SNAME("ArrowUp"), EditorStringName(EditorIcons));
- theme_cache.incoming_bandwidth_color = get_theme_color(SNAME("font_color"), EditorStringName(Editor));
- theme_cache.outgoing_bandwidth_color = get_theme_color(SNAME("font_color"), EditorStringName(Editor));
+ theme_cache.incoming_bandwidth_color = get_theme_color(SceneStringName(font_color), EditorStringName(Editor));
+ theme_cache.outgoing_bandwidth_color = get_theme_color(SceneStringName(font_color), EditorStringName(Editor));
}
void EditorNetworkProfiler::_refresh() {
diff --git a/modules/navigation/nav_map.cpp b/modules/navigation/nav_map.cpp
index 1779be2cc2..f0184a155b 100644
--- a/modules/navigation/nav_map.cpp
+++ b/modules/navigation/nav_map.cpp
@@ -627,24 +627,20 @@ Vector3 NavMap::get_closest_point_to_segment(const Vector3 &p_from, const Vector
closest_point_d = d;
}
}
- }
-
- if (use_collision == false) {
- for (size_t point_id = 0; point_id < p.points.size(); point_id += 1) {
- Vector3 a, b;
-
- Geometry3D::get_closest_points_between_segments(
- p_from,
- p_to,
- p.points[point_id].pos,
- p.points[(point_id + 1) % p.points.size()].pos,
- a,
- b);
+ // If segment does not itersect face, check the distance from segment's endpoints.
+ else if (!use_collision) {
+ const Vector3 p_from_closest = f.get_closest_point_to(p_from);
+ const real_t d_p_from = p_from.distance_to(p_from_closest);
+ if (closest_point_d > d_p_from) {
+ closest_point = p_from_closest;
+ closest_point_d = d_p_from;
+ }
- const real_t d = a.distance_to(b);
- if (d < closest_point_d) {
- closest_point_d = d;
- closest_point = b;
+ const Vector3 p_to_closest = f.get_closest_point_to(p_to);
+ const real_t d_p_to = p_to.distance_to(p_to_closest);
+ if (closest_point_d > d_p_to) {
+ closest_point = p_to_closest;
+ closest_point_d = d_p_to;
}
}
}
diff --git a/modules/text_server_adv/text_server_adv.cpp b/modules/text_server_adv/text_server_adv.cpp
index 361d88af90..33ba2da761 100644
--- a/modules/text_server_adv/text_server_adv.cpp
+++ b/modules/text_server_adv/text_server_adv.cpp
@@ -6052,6 +6052,7 @@ void TextServerAdvanced::_shape_run(ShapedTextDataAdvanced *p_sd, int64_t p_star
unsigned int last_cluster_index = 0;
bool last_cluster_valid = true;
+ double adv_rem = 0.0;
for (unsigned int i = 0; i < glyph_count; i++) {
if ((i > 0) && (last_cluster_id != glyph_info[i].cluster)) {
if (p_direction == HB_DIRECTION_RTL || p_direction == HB_DIRECTION_BTT) {
@@ -6097,21 +6098,31 @@ void TextServerAdvanced::_shape_run(ShapedTextDataAdvanced *p_sd, int64_t p_star
gl.index = glyph_info[i].codepoint;
if (gl.index != 0) {
_ensure_glyph(fd, fss, gl.index | mod);
+ if (subpos) {
+ gl.x_off = (double)glyph_pos[i].x_offset / (64.0 / scale);
+ } else if (p_sd->orientation == ORIENTATION_HORIZONTAL) {
+ gl.x_off = Math::round(adv_rem + ((double)glyph_pos[i].x_offset / (64.0 / scale)));
+ } else {
+ gl.x_off = Math::round((double)glyph_pos[i].x_offset / (64.0 / scale));
+ }
+ if (p_sd->orientation == ORIENTATION_HORIZONTAL) {
+ gl.y_off = -Math::round((double)glyph_pos[i].y_offset / (64.0 / scale));
+ } else {
+ gl.y_off = -Math::round(adv_rem + ((double)glyph_pos[i].y_offset / (64.0 / scale)));
+ }
if (p_sd->orientation == ORIENTATION_HORIZONTAL) {
if (subpos) {
gl.advance = (double)glyph_pos[i].x_advance / (64.0 / scale) + ea;
} else {
- gl.advance = Math::round((double)glyph_pos[i].x_advance / (64.0 / scale) + ea);
+ double full_adv = adv_rem + ((double)glyph_pos[i].x_advance / (64.0 / scale) + ea);
+ gl.advance = Math::round(full_adv);
+ adv_rem = full_adv - gl.advance;
}
} else {
- gl.advance = -Math::round((double)glyph_pos[i].y_advance / (64.0 / scale));
- }
- if (subpos) {
- gl.x_off = (double)glyph_pos[i].x_offset / (64.0 / scale);
- } else {
- gl.x_off = Math::round((double)glyph_pos[i].x_offset / (64.0 / scale));
+ double full_adv = adv_rem + ((double)glyph_pos[i].y_advance / (64.0 / scale));
+ gl.advance = -Math::round(full_adv);
+ adv_rem = full_adv + gl.advance;
}
- gl.y_off = -Math::round((double)glyph_pos[i].y_offset / (64.0 / scale));
if (p_sd->orientation == ORIENTATION_HORIZONTAL) {
gl.y_off += _font_get_baseline_offset(gl.font_rid) * (double)(_font_get_ascent(gl.font_rid, gl.font_size) + _font_get_descent(gl.font_rid, gl.font_size));
} else {