summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
Diffstat (limited to 'editor')
-rw-r--r--editor/editor_fonts.cpp12
-rw-r--r--editor/editor_help.cpp14
-rw-r--r--editor/import/editor_scene_importer_gltf.cpp13
3 files changed, 19 insertions, 20 deletions
diff --git a/editor/editor_fonts.cpp b/editor/editor_fonts.cpp
index cf14cf3e00..40ecffbb3b 100644
--- a/editor/editor_fonts.cpp
+++ b/editor/editor_fonts.cpp
@@ -204,7 +204,6 @@ void editor_register_fonts(Ref<Theme> p_theme) {
dfmono->set_antialiased(font_source_antialiased);
dfmono->set_hinting(font_source_hinting);
dfmono->set_font_ptr(_font_Hack_Regular, _font_Hack_Regular_size);
- //dfd->set_force_autohinter(true); //just looks better..i think?
int default_font_size = int(EDITOR_GET("interface/editor/main_font_size")) * EDSCALE;
@@ -220,15 +219,14 @@ void editor_register_fonts(Ref<Theme> p_theme) {
MAKE_BOLD_FONT(df_title, default_font_size + 2 * EDSCALE);
p_theme->set_font("title", "EditorFonts", df_title);
- // Doc font
- MAKE_BOLD_FONT(df_doc_title, int(EDITOR_GET("text_editor/help/help_title_font_size")) * EDSCALE);
-
+ // Documentation fonts
MAKE_DEFAULT_FONT(df_doc, int(EDITOR_GET("text_editor/help/help_font_size")) * EDSCALE);
-
+ MAKE_BOLD_FONT(df_doc_bold, int(EDITOR_GET("text_editor/help/help_font_size")) * EDSCALE);
+ MAKE_BOLD_FONT(df_doc_title, int(EDITOR_GET("text_editor/help/help_title_font_size")) * EDSCALE);
+ MAKE_SOURCE_FONT(df_doc_code, int(EDITOR_GET("text_editor/help/help_source_font_size")) * EDSCALE);
p_theme->set_font("doc", "EditorFonts", df_doc);
+ p_theme->set_font("doc_bold", "EditorFonts", df_doc_bold);
p_theme->set_font("doc_title", "EditorFonts", df_doc_title);
-
- MAKE_SOURCE_FONT(df_doc_code, int(EDITOR_GET("text_editor/help/help_source_font_size")) * EDSCALE);
p_theme->set_font("doc_source", "EditorFonts", df_doc_code);
// Ruler font
diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp
index df25b08b4c..26d793cf65 100644
--- a/editor/editor_help.cpp
+++ b/editor/editor_help.cpp
@@ -325,6 +325,7 @@ void EditorHelp::_update_doc() {
DocData::ClassDoc cd = doc->class_list[edited_class]; //make a copy, so we can sort without worrying
Ref<Font> doc_font = get_font("doc", "EditorFonts");
+ Ref<Font> doc_bold_font = get_font("doc_bold", "EditorFonts");
Ref<Font> doc_title_font = get_font("doc_title", "EditorFonts");
Ref<Font> doc_code_font = get_font("doc_source", "EditorFonts");
String link_color_text = title_color.to_html(false);
@@ -1132,6 +1133,7 @@ static void _add_text_to_rt(const String &p_bbcode, RichTextLabel *p_rt) {
String base_path;
Ref<Font> doc_font = p_rt->get_font("doc", "EditorFonts");
+ Ref<Font> doc_bold_font = p_rt->get_font("doc_bold", "EditorFonts");
Ref<Font> doc_code_font = p_rt->get_font("doc_source", "EditorFonts");
Color font_color_hl = p_rt->get_color("headline_color", "EditorHelp");
Color link_color = p_rt->get_color("accent_color", "Editor").linear_interpolate(font_color_hl, 0.8);
@@ -1219,7 +1221,7 @@ static void _add_text_to_rt(const String &p_bbcode, RichTextLabel *p_rt) {
} else if (tag == "b") {
//use bold font
- p_rt->push_font(doc_code_font);
+ p_rt->push_font(doc_bold_font);
pos = brk_end + 1;
tag_stack.push_front(tag);
} else if (tag == "i") {
@@ -1237,13 +1239,13 @@ static void _add_text_to_rt(const String &p_bbcode, RichTextLabel *p_rt) {
tag_stack.push_front(tag);
} else if (tag == "center") {
- //use monospace font
+ //align to center
p_rt->push_align(RichTextLabel::ALIGN_CENTER);
pos = brk_end + 1;
tag_stack.push_front(tag);
} else if (tag == "br") {
- //use monospace font
+ //force a line break
p_rt->add_newline();
pos = brk_end + 1;
} else if (tag == "u") {
@@ -1254,14 +1256,13 @@ static void _add_text_to_rt(const String &p_bbcode, RichTextLabel *p_rt) {
tag_stack.push_front(tag);
} else if (tag == "s") {
- //use strikethrough (not supported underline instead)
- p_rt->push_underline();
+ //use strikethrough
+ p_rt->push_strikethrough();
pos = brk_end + 1;
tag_stack.push_front(tag);
} else if (tag == "url") {
- //use strikethrough (not supported underline instead)
int end = bbcode.find("[", brk_end);
if (end == -1)
end = bbcode.length();
@@ -1278,7 +1279,6 @@ static void _add_text_to_rt(const String &p_bbcode, RichTextLabel *p_rt) {
tag_stack.push_front("url");
} else if (tag == "img") {
- //use strikethrough (not supported underline instead)
int end = bbcode.find("[", brk_end);
if (end == -1)
end = bbcode.length();
diff --git a/editor/import/editor_scene_importer_gltf.cpp b/editor/import/editor_scene_importer_gltf.cpp
index daa423e1d9..c97021433b 100644
--- a/editor/import/editor_scene_importer_gltf.cpp
+++ b/editor/import/editor_scene_importer_gltf.cpp
@@ -2090,22 +2090,23 @@ void EditorSceneImporterGLTF::_import_animation(GLTFState &state, AnimationPlaye
animation->add_track(Animation::TYPE_VALUE);
animation->track_set_path(track_idx, node_path);
- if (track.weight_tracks[i].interpolation <= GLTFAnimation::INTERP_STEP) {
- animation->track_set_interpolation_type(track_idx, track.weight_tracks[i].interpolation == GLTFAnimation::INTERP_STEP ? Animation::INTERPOLATION_NEAREST : Animation::INTERPOLATION_NEAREST);
+ // Only LINEAR and STEP (NEAREST) can be supported out of the box by Godot's Animation,
+ // the other modes have to be baked.
+ GLTFAnimation::Interpolation gltf_interp = track.weight_tracks[i].interpolation;
+ if (gltf_interp == GLTFAnimation::INTERP_LINEAR || gltf_interp == GLTFAnimation::INTERP_STEP) {
+ animation->track_set_interpolation_type(track_idx, gltf_interp == GLTFAnimation::INTERP_STEP ? Animation::INTERPOLATION_NEAREST : Animation::INTERPOLATION_LINEAR);
for (int j = 0; j < track.weight_tracks[i].times.size(); j++) {
float t = track.weight_tracks[i].times[j];
float w = track.weight_tracks[i].values[j];
animation->track_insert_key(track_idx, t, w);
}
} else {
- //must bake, apologies.
+ // CATMULLROMSPLINE or CUBIC_SPLINE have to be baked, apologies.
float increment = 1.0 / float(bake_fps);
float time = 0.0;
-
bool last = false;
while (true) {
-
- _interpolate_track<float>(track.weight_tracks[i].times, track.weight_tracks[i].values, time, track.weight_tracks[i].interpolation);
+ _interpolate_track<float>(track.weight_tracks[i].times, track.weight_tracks[i].values, time, gltf_interp);
if (last) {
break;
}