diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-12-09 10:22:24 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-09 10:22:24 +0100 |
commit | 4129c1d140b8c48b64c993fdfa6083e0ec59c8f0 (patch) | |
tree | 64fa9af1dc2f924c9e3ea7c0cdc65e84b1d2ebfb /modules | |
parent | dcca8aba4f01dfc55c1d7adb6bef7bee684cf447 (diff) | |
parent | 41a20171eb81a7850dd96ec31da4b40c619538a2 (diff) |
Merge pull request #55299 from nathanfranke/renames
Diffstat (limited to 'modules')
-rw-r--r-- | modules/gdnative/gdnative_library_editor_plugin.cpp | 4 | ||||
-rw-r--r-- | modules/gridmap/grid_map_editor_plugin.cpp | 6 | ||||
-rw-r--r-- | modules/text_server_adv/text_server_adv.cpp | 112 | ||||
-rw-r--r-- | modules/text_server_adv/text_server_adv.h | 4 | ||||
-rw-r--r-- | modules/text_server_fb/text_server_fb.cpp | 112 | ||||
-rw-r--r-- | modules/text_server_fb/text_server_fb.h | 4 | ||||
-rw-r--r-- | modules/visual_script/editor/visual_script_editor.cpp | 12 |
7 files changed, 127 insertions, 127 deletions
diff --git a/modules/gdnative/gdnative_library_editor_plugin.cpp b/modules/gdnative/gdnative_library_editor_plugin.cpp index 9dad13a615..df3c37f730 100644 --- a/modules/gdnative/gdnative_library_editor_plugin.cpp +++ b/modules/gdnative/gdnative_library_editor_plugin.cpp @@ -110,7 +110,7 @@ void GDNativeLibraryEditor::_update_tree() { TreeItem *new_arch = tree->create_item(platform); new_arch->set_text(0, TTR("Double click to create a new entry")); - new_arch->set_text_align(0, TreeItem::ALIGN_CENTER); + new_arch->set_text_alignment(0, HORIZONTAL_ALIGNMENT_CENTER); new_arch->set_custom_color(0, get_theme_color(SNAME("accent_color"), SNAME("Editor"))); new_arch->set_expand_right(0, true); new_arch->set_metadata(1, E->key()); @@ -335,7 +335,7 @@ GDNativeLibraryEditor::GDNativeLibraryEditor() { hbox->add_child(label); filter = memnew(MenuButton); filter->set_h_size_flags(SIZE_EXPAND_FILL); - filter->set_text_align(filter->ALIGN_LEFT); + filter->set_text_alignment(HORIZONTAL_ALIGNMENT_LEFT); hbox->add_child(filter); PopupMenu *filter_list = filter->get_popup(); filter_list->set_hide_on_checkable_item_selection(false); diff --git a/modules/gridmap/grid_map_editor_plugin.cpp b/modules/gridmap/grid_map_editor_plugin.cpp index d827ce2fb0..cf37f75d05 100644 --- a/modules/gridmap/grid_map_editor_plugin.cpp +++ b/modules/gridmap/grid_map_editor_plugin.cpp @@ -1163,7 +1163,7 @@ GridMapEditor::GridMapEditor(EditorNode *p_editor) { spatial_editor_hb = memnew(HBoxContainer); spatial_editor_hb->set_h_size_flags(SIZE_EXPAND_FILL); - spatial_editor_hb->set_alignment(BoxContainer::ALIGN_END); + spatial_editor_hb->set_alignment(BoxContainer::ALIGNMENT_END); Node3DEditor::get_singleton()->add_control_to_menu_panel(spatial_editor_hb); spin_box_label = memnew(Label); @@ -1280,8 +1280,8 @@ GridMapEditor::GridMapEditor(EditorNode *p_editor) { info_message = memnew(Label); info_message->set_text(TTR("Give a MeshLibrary resource to this GridMap to use its meshes.")); - info_message->set_valign(Label::VALIGN_CENTER); - info_message->set_align(Label::ALIGN_CENTER); + info_message->set_vertical_alignment(VERTICAL_ALIGNMENT_CENTER); + info_message->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER); info_message->set_autowrap_mode(Label::AUTOWRAP_WORD_SMART); info_message->set_custom_minimum_size(Size2(100 * EDSCALE, 0)); info_message->set_anchors_and_offsets_preset(PRESET_WIDE, PRESET_MODE_KEEP_SIZE, 8 * EDSCALE); diff --git a/modules/text_server_adv/text_server_adv.cpp b/modules/text_server_adv/text_server_adv.cpp index f480c86088..aa8978a430 100644 --- a/modules/text_server_adv/text_server_adv.cpp +++ b/modules/text_server_adv/text_server_adv.cpp @@ -3144,7 +3144,7 @@ bool TextServerAdvanced::shaped_text_add_string(RID p_shaped, const String &p_te return true; } -bool TextServerAdvanced::shaped_text_add_object(RID p_shaped, Variant p_key, const Size2 &p_size, InlineAlign p_inline_align, int p_length) { +bool TextServerAdvanced::shaped_text_add_object(RID p_shaped, Variant p_key, const Size2 &p_size, InlineAlignment p_inline_align, int p_length) { _THREAD_SAFE_METHOD_ ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, false); @@ -3174,7 +3174,7 @@ bool TextServerAdvanced::shaped_text_add_object(RID p_shaped, Variant p_key, con return true; } -bool TextServerAdvanced::shaped_text_resize_object(RID p_shaped, Variant p_key, const Size2 &p_size, InlineAlign p_inline_align) { +bool TextServerAdvanced::shaped_text_resize_object(RID p_shaped, Variant p_key, const Size2 &p_size, InlineAlignment p_inline_align) { ShapedTextData *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, false); @@ -3242,56 +3242,56 @@ bool TextServerAdvanced::shaped_text_resize_object(RID p_shaped, Variant p_key, for (KeyValue<Variant, ShapedTextData::EmbeddedObject> &E : sd->objects) { if ((E.value.pos >= sd->start) && (E.value.pos < sd->end)) { if (sd->orientation == ORIENTATION_HORIZONTAL) { - switch (E.value.inline_align & INLINE_ALIGN_TEXT_MASK) { - case INLINE_ALIGN_TO_TOP: { + switch (E.value.inline_align & INLINE_ALIGNMENT_TEXT_MASK) { + case INLINE_ALIGNMENT_TO_TOP: { E.value.rect.position.y = -sd->ascent; } break; - case INLINE_ALIGN_TO_CENTER: { + case INLINE_ALIGNMENT_TO_CENTER: { E.value.rect.position.y = (-sd->ascent + sd->descent) / 2; } break; - case INLINE_ALIGN_TO_BASELINE: { + case INLINE_ALIGNMENT_TO_BASELINE: { E.value.rect.position.y = 0; } break; - case INLINE_ALIGN_TO_BOTTOM: { + case INLINE_ALIGNMENT_TO_BOTTOM: { E.value.rect.position.y = sd->descent; } break; } - switch (E.value.inline_align & INLINE_ALIGN_IMAGE_MASK) { - case INLINE_ALIGN_BOTTOM_TO: { + switch (E.value.inline_align & INLINE_ALIGNMENT_IMAGE_MASK) { + case INLINE_ALIGNMENT_BOTTOM_TO: { E.value.rect.position.y -= E.value.rect.size.y; } break; - case INLINE_ALIGN_CENTER_TO: { + case INLINE_ALIGNMENT_CENTER_TO: { E.value.rect.position.y -= E.value.rect.size.y / 2; } break; - case INLINE_ALIGN_TOP_TO: { + case INLINE_ALIGNMENT_TOP_TO: { // NOP } break; } full_ascent = MAX(full_ascent, -E.value.rect.position.y); full_descent = MAX(full_descent, E.value.rect.position.y + E.value.rect.size.y); } else { - switch (E.value.inline_align & INLINE_ALIGN_TEXT_MASK) { - case INLINE_ALIGN_TO_TOP: { + switch (E.value.inline_align & INLINE_ALIGNMENT_TEXT_MASK) { + case INLINE_ALIGNMENT_TO_TOP: { E.value.rect.position.x = -sd->ascent; } break; - case INLINE_ALIGN_TO_CENTER: { + case INLINE_ALIGNMENT_TO_CENTER: { E.value.rect.position.x = (-sd->ascent + sd->descent) / 2; } break; - case INLINE_ALIGN_TO_BASELINE: { + case INLINE_ALIGNMENT_TO_BASELINE: { E.value.rect.position.x = 0; } break; - case INLINE_ALIGN_TO_BOTTOM: { + case INLINE_ALIGNMENT_TO_BOTTOM: { E.value.rect.position.x = sd->descent; } break; } - switch (E.value.inline_align & INLINE_ALIGN_IMAGE_MASK) { - case INLINE_ALIGN_BOTTOM_TO: { + switch (E.value.inline_align & INLINE_ALIGNMENT_IMAGE_MASK) { + case INLINE_ALIGNMENT_BOTTOM_TO: { E.value.rect.position.x -= E.value.rect.size.x; } break; - case INLINE_ALIGN_CENTER_TO: { + case INLINE_ALIGNMENT_CENTER_TO: { E.value.rect.position.x -= E.value.rect.size.x / 2; } break; - case INLINE_ALIGN_TOP_TO: { + case INLINE_ALIGNMENT_TOP_TO: { // NOP } break; } @@ -3433,56 +3433,56 @@ RID TextServerAdvanced::shaped_text_substr(RID p_shaped, int p_start, int p_leng for (KeyValue<Variant, ShapedTextData::EmbeddedObject> &E : new_sd->objects) { if ((E.value.pos >= new_sd->start) && (E.value.pos < new_sd->end)) { if (sd->orientation == ORIENTATION_HORIZONTAL) { - switch (E.value.inline_align & INLINE_ALIGN_TEXT_MASK) { - case INLINE_ALIGN_TO_TOP: { + switch (E.value.inline_align & INLINE_ALIGNMENT_TEXT_MASK) { + case INLINE_ALIGNMENT_TO_TOP: { E.value.rect.position.y = -new_sd->ascent; } break; - case INLINE_ALIGN_TO_CENTER: { + case INLINE_ALIGNMENT_TO_CENTER: { E.value.rect.position.y = (-new_sd->ascent + new_sd->descent) / 2; } break; - case INLINE_ALIGN_TO_BASELINE: { + case INLINE_ALIGNMENT_TO_BASELINE: { E.value.rect.position.y = 0; } break; - case INLINE_ALIGN_TO_BOTTOM: { + case INLINE_ALIGNMENT_TO_BOTTOM: { E.value.rect.position.y = new_sd->descent; } break; } - switch (E.value.inline_align & INLINE_ALIGN_IMAGE_MASK) { - case INLINE_ALIGN_BOTTOM_TO: { + switch (E.value.inline_align & INLINE_ALIGNMENT_IMAGE_MASK) { + case INLINE_ALIGNMENT_BOTTOM_TO: { E.value.rect.position.y -= E.value.rect.size.y; } break; - case INLINE_ALIGN_CENTER_TO: { + case INLINE_ALIGNMENT_CENTER_TO: { E.value.rect.position.y -= E.value.rect.size.y / 2; } break; - case INLINE_ALIGN_TOP_TO: { + case INLINE_ALIGNMENT_TOP_TO: { // NOP } break; } full_ascent = MAX(full_ascent, -E.value.rect.position.y); full_descent = MAX(full_descent, E.value.rect.position.y + E.value.rect.size.y); } else { - switch (E.value.inline_align & INLINE_ALIGN_TEXT_MASK) { - case INLINE_ALIGN_TO_TOP: { + switch (E.value.inline_align & INLINE_ALIGNMENT_TEXT_MASK) { + case INLINE_ALIGNMENT_TO_TOP: { E.value.rect.position.x = -new_sd->ascent; } break; - case INLINE_ALIGN_TO_CENTER: { + case INLINE_ALIGNMENT_TO_CENTER: { E.value.rect.position.x = (-new_sd->ascent + new_sd->descent) / 2; } break; - case INLINE_ALIGN_TO_BASELINE: { + case INLINE_ALIGNMENT_TO_BASELINE: { E.value.rect.position.x = 0; } break; - case INLINE_ALIGN_TO_BOTTOM: { + case INLINE_ALIGNMENT_TO_BOTTOM: { E.value.rect.position.x = new_sd->descent; } break; } - switch (E.value.inline_align & INLINE_ALIGN_IMAGE_MASK) { - case INLINE_ALIGN_BOTTOM_TO: { + switch (E.value.inline_align & INLINE_ALIGNMENT_IMAGE_MASK) { + case INLINE_ALIGNMENT_BOTTOM_TO: { E.value.rect.position.x -= E.value.rect.size.x; } break; - case INLINE_ALIGN_CENTER_TO: { + case INLINE_ALIGNMENT_CENTER_TO: { E.value.rect.position.x -= E.value.rect.size.x / 2; } break; - case INLINE_ALIGN_TOP_TO: { + case INLINE_ALIGNMENT_TOP_TO: { // NOP } break; } @@ -4579,56 +4579,56 @@ bool TextServerAdvanced::shaped_text_shape(RID p_shaped) { float full_descent = sd->descent; for (KeyValue<Variant, ShapedTextData::EmbeddedObject> &E : sd->objects) { if (sd->orientation == ORIENTATION_HORIZONTAL) { - switch (E.value.inline_align & INLINE_ALIGN_TEXT_MASK) { - case INLINE_ALIGN_TO_TOP: { + switch (E.value.inline_align & INLINE_ALIGNMENT_TEXT_MASK) { + case INLINE_ALIGNMENT_TO_TOP: { E.value.rect.position.y = -sd->ascent; } break; - case INLINE_ALIGN_TO_CENTER: { + case INLINE_ALIGNMENT_TO_CENTER: { E.value.rect.position.y = (-sd->ascent + sd->descent) / 2; } break; - case INLINE_ALIGN_TO_BASELINE: { + case INLINE_ALIGNMENT_TO_BASELINE: { E.value.rect.position.y = 0; } break; - case INLINE_ALIGN_TO_BOTTOM: { + case INLINE_ALIGNMENT_TO_BOTTOM: { E.value.rect.position.y = sd->descent; } break; } - switch (E.value.inline_align & INLINE_ALIGN_IMAGE_MASK) { - case INLINE_ALIGN_BOTTOM_TO: { + switch (E.value.inline_align & INLINE_ALIGNMENT_IMAGE_MASK) { + case INLINE_ALIGNMENT_BOTTOM_TO: { E.value.rect.position.y -= E.value.rect.size.y; } break; - case INLINE_ALIGN_CENTER_TO: { + case INLINE_ALIGNMENT_CENTER_TO: { E.value.rect.position.y -= E.value.rect.size.y / 2; } break; - case INLINE_ALIGN_TOP_TO: { + case INLINE_ALIGNMENT_TOP_TO: { // NOP } break; } full_ascent = MAX(full_ascent, -E.value.rect.position.y); full_descent = MAX(full_descent, E.value.rect.position.y + E.value.rect.size.y); } else { - switch (E.value.inline_align & INLINE_ALIGN_TEXT_MASK) { - case INLINE_ALIGN_TO_TOP: { + switch (E.value.inline_align & INLINE_ALIGNMENT_TEXT_MASK) { + case INLINE_ALIGNMENT_TO_TOP: { E.value.rect.position.x = -sd->ascent; } break; - case INLINE_ALIGN_TO_CENTER: { + case INLINE_ALIGNMENT_TO_CENTER: { E.value.rect.position.x = (-sd->ascent + sd->descent) / 2; } break; - case INLINE_ALIGN_TO_BASELINE: { + case INLINE_ALIGNMENT_TO_BASELINE: { E.value.rect.position.x = 0; } break; - case INLINE_ALIGN_TO_BOTTOM: { + case INLINE_ALIGNMENT_TO_BOTTOM: { E.value.rect.position.x = sd->descent; } break; } - switch (E.value.inline_align & INLINE_ALIGN_IMAGE_MASK) { - case INLINE_ALIGN_BOTTOM_TO: { + switch (E.value.inline_align & INLINE_ALIGNMENT_IMAGE_MASK) { + case INLINE_ALIGNMENT_BOTTOM_TO: { E.value.rect.position.x -= E.value.rect.size.x; } break; - case INLINE_ALIGN_CENTER_TO: { + case INLINE_ALIGNMENT_CENTER_TO: { E.value.rect.position.x -= E.value.rect.size.x / 2; } break; - case INLINE_ALIGN_TOP_TO: { + case INLINE_ALIGNMENT_TOP_TO: { // NOP } break; } diff --git a/modules/text_server_adv/text_server_adv.h b/modules/text_server_adv/text_server_adv.h index 5eaff67a6e..414db8c7ea 100644 --- a/modules/text_server_adv/text_server_adv.h +++ b/modules/text_server_adv/text_server_adv.h @@ -476,8 +476,8 @@ public: virtual bool shaped_text_get_preserve_control(RID p_shaped) const override; virtual bool shaped_text_add_string(RID p_shaped, const String &p_text, const Vector<RID> &p_fonts, int p_size, const Dictionary &p_opentype_features = Dictionary(), const String &p_language = "") override; - virtual bool shaped_text_add_object(RID p_shaped, Variant p_key, const Size2 &p_size, InlineAlign p_inline_align = INLINE_ALIGN_CENTER, int p_length = 1) override; - virtual bool shaped_text_resize_object(RID p_shaped, Variant p_key, const Size2 &p_size, InlineAlign p_inline_align = INLINE_ALIGN_CENTER) override; + virtual bool shaped_text_add_object(RID p_shaped, Variant p_key, const Size2 &p_size, InlineAlignment p_inline_align = INLINE_ALIGNMENT_CENTER, int p_length = 1) override; + virtual bool shaped_text_resize_object(RID p_shaped, Variant p_key, const Size2 &p_size, InlineAlignment p_inline_align = INLINE_ALIGNMENT_CENTER) override; virtual RID shaped_text_substr(RID p_shaped, int p_start, int p_length) const override; virtual RID shaped_text_get_parent(RID p_shaped) const override; diff --git a/modules/text_server_fb/text_server_fb.cpp b/modules/text_server_fb/text_server_fb.cpp index 5c06051211..97a53143cf 100644 --- a/modules/text_server_fb/text_server_fb.cpp +++ b/modules/text_server_fb/text_server_fb.cpp @@ -2247,7 +2247,7 @@ bool TextServerFallback::shaped_text_add_string(RID p_shaped, const String &p_te return true; } -bool TextServerFallback::shaped_text_add_object(RID p_shaped, Variant p_key, const Size2 &p_size, InlineAlign p_inline_align, int p_length) { +bool TextServerFallback::shaped_text_add_object(RID p_shaped, Variant p_key, const Size2 &p_size, InlineAlignment p_inline_align, int p_length) { ShapedTextData *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, false); @@ -2278,7 +2278,7 @@ bool TextServerFallback::shaped_text_add_object(RID p_shaped, Variant p_key, con return true; } -bool TextServerFallback::shaped_text_resize_object(RID p_shaped, Variant p_key, const Size2 &p_size, InlineAlign p_inline_align) { +bool TextServerFallback::shaped_text_resize_object(RID p_shaped, Variant p_key, const Size2 &p_size, InlineAlignment p_inline_align) { ShapedTextData *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, false); @@ -2346,56 +2346,56 @@ bool TextServerFallback::shaped_text_resize_object(RID p_shaped, Variant p_key, for (KeyValue<Variant, ShapedTextData::EmbeddedObject> &E : sd->objects) { if ((E.value.pos >= sd->start) && (E.value.pos < sd->end)) { if (sd->orientation == ORIENTATION_HORIZONTAL) { - switch (E.value.inline_align & INLINE_ALIGN_TEXT_MASK) { - case INLINE_ALIGN_TO_TOP: { + switch (E.value.inline_align & INLINE_ALIGNMENT_TEXT_MASK) { + case INLINE_ALIGNMENT_TO_TOP: { E.value.rect.position.y = -sd->ascent; } break; - case INLINE_ALIGN_TO_CENTER: { + case INLINE_ALIGNMENT_TO_CENTER: { E.value.rect.position.y = (-sd->ascent + sd->descent) / 2; } break; - case INLINE_ALIGN_TO_BASELINE: { + case INLINE_ALIGNMENT_TO_BASELINE: { E.value.rect.position.y = 0; } break; - case INLINE_ALIGN_TO_BOTTOM: { + case INLINE_ALIGNMENT_TO_BOTTOM: { E.value.rect.position.y = sd->descent; } break; } - switch (E.value.inline_align & INLINE_ALIGN_IMAGE_MASK) { - case INLINE_ALIGN_BOTTOM_TO: { + switch (E.value.inline_align & INLINE_ALIGNMENT_IMAGE_MASK) { + case INLINE_ALIGNMENT_BOTTOM_TO: { E.value.rect.position.y -= E.value.rect.size.y; } break; - case INLINE_ALIGN_CENTER_TO: { + case INLINE_ALIGNMENT_CENTER_TO: { E.value.rect.position.y -= E.value.rect.size.y / 2; } break; - case INLINE_ALIGN_TOP_TO: { + case INLINE_ALIGNMENT_TOP_TO: { // NOP } break; } full_ascent = MAX(full_ascent, -E.value.rect.position.y); full_descent = MAX(full_descent, E.value.rect.position.y + E.value.rect.size.y); } else { - switch (E.value.inline_align & INLINE_ALIGN_TEXT_MASK) { - case INLINE_ALIGN_TO_TOP: { + switch (E.value.inline_align & INLINE_ALIGNMENT_TEXT_MASK) { + case INLINE_ALIGNMENT_TO_TOP: { E.value.rect.position.x = -sd->ascent; } break; - case INLINE_ALIGN_TO_CENTER: { + case INLINE_ALIGNMENT_TO_CENTER: { E.value.rect.position.x = (-sd->ascent + sd->descent) / 2; } break; - case INLINE_ALIGN_TO_BASELINE: { + case INLINE_ALIGNMENT_TO_BASELINE: { E.value.rect.position.x = 0; } break; - case INLINE_ALIGN_TO_BOTTOM: { + case INLINE_ALIGNMENT_TO_BOTTOM: { E.value.rect.position.x = sd->descent; } break; } - switch (E.value.inline_align & INLINE_ALIGN_IMAGE_MASK) { - case INLINE_ALIGN_BOTTOM_TO: { + switch (E.value.inline_align & INLINE_ALIGNMENT_IMAGE_MASK) { + case INLINE_ALIGNMENT_BOTTOM_TO: { E.value.rect.position.x -= E.value.rect.size.x; } break; - case INLINE_ALIGN_CENTER_TO: { + case INLINE_ALIGNMENT_CENTER_TO: { E.value.rect.position.x -= E.value.rect.size.x / 2; } break; - case INLINE_ALIGN_TOP_TO: { + case INLINE_ALIGNMENT_TOP_TO: { // NOP } break; } @@ -2498,56 +2498,56 @@ RID TextServerFallback::shaped_text_substr(RID p_shaped, int p_start, int p_leng for (KeyValue<Variant, ShapedTextData::EmbeddedObject> &E : new_sd->objects) { if ((E.value.pos >= new_sd->start) && (E.value.pos < new_sd->end)) { if (sd->orientation == ORIENTATION_HORIZONTAL) { - switch (E.value.inline_align & INLINE_ALIGN_TEXT_MASK) { - case INLINE_ALIGN_TO_TOP: { + switch (E.value.inline_align & INLINE_ALIGNMENT_TEXT_MASK) { + case INLINE_ALIGNMENT_TO_TOP: { E.value.rect.position.y = -new_sd->ascent; } break; - case INLINE_ALIGN_TO_CENTER: { + case INLINE_ALIGNMENT_TO_CENTER: { E.value.rect.position.y = (-new_sd->ascent + new_sd->descent) / 2; } break; - case INLINE_ALIGN_TO_BASELINE: { + case INLINE_ALIGNMENT_TO_BASELINE: { E.value.rect.position.y = 0; } break; - case INLINE_ALIGN_TO_BOTTOM: { + case INLINE_ALIGNMENT_TO_BOTTOM: { E.value.rect.position.y = new_sd->descent; } break; } - switch (E.value.inline_align & INLINE_ALIGN_IMAGE_MASK) { - case INLINE_ALIGN_BOTTOM_TO: { + switch (E.value.inline_align & INLINE_ALIGNMENT_IMAGE_MASK) { + case INLINE_ALIGNMENT_BOTTOM_TO: { E.value.rect.position.y -= E.value.rect.size.y; } break; - case INLINE_ALIGN_CENTER_TO: { + case INLINE_ALIGNMENT_CENTER_TO: { E.value.rect.position.y -= E.value.rect.size.y / 2; } break; - case INLINE_ALIGN_TOP_TO: { + case INLINE_ALIGNMENT_TOP_TO: { // NOP } break; } full_ascent = MAX(full_ascent, -E.value.rect.position.y); full_descent = MAX(full_descent, E.value.rect.position.y + E.value.rect.size.y); } else { - switch (E.value.inline_align & INLINE_ALIGN_TEXT_MASK) { - case INLINE_ALIGN_TO_TOP: { + switch (E.value.inline_align & INLINE_ALIGNMENT_TEXT_MASK) { + case INLINE_ALIGNMENT_TO_TOP: { E.value.rect.position.x = -new_sd->ascent; } break; - case INLINE_ALIGN_TO_CENTER: { + case INLINE_ALIGNMENT_TO_CENTER: { E.value.rect.position.x = (-new_sd->ascent + new_sd->descent) / 2; } break; - case INLINE_ALIGN_TO_BASELINE: { + case INLINE_ALIGNMENT_TO_BASELINE: { E.value.rect.position.x = 0; } break; - case INLINE_ALIGN_TO_BOTTOM: { + case INLINE_ALIGNMENT_TO_BOTTOM: { E.value.rect.position.x = new_sd->descent; } break; } - switch (E.value.inline_align & INLINE_ALIGN_IMAGE_MASK) { - case INLINE_ALIGN_BOTTOM_TO: { + switch (E.value.inline_align & INLINE_ALIGNMENT_IMAGE_MASK) { + case INLINE_ALIGNMENT_BOTTOM_TO: { E.value.rect.position.x -= E.value.rect.size.x; } break; - case INLINE_ALIGN_CENTER_TO: { + case INLINE_ALIGNMENT_CENTER_TO: { E.value.rect.position.x -= E.value.rect.size.x / 2; } break; - case INLINE_ALIGN_TOP_TO: { + case INLINE_ALIGNMENT_TOP_TO: { // NOP } break; } @@ -3052,56 +3052,56 @@ bool TextServerFallback::shaped_text_shape(RID p_shaped) { float full_descent = sd->descent; for (KeyValue<Variant, ShapedTextData::EmbeddedObject> &E : sd->objects) { if (sd->orientation == ORIENTATION_HORIZONTAL) { - switch (E.value.inline_align & INLINE_ALIGN_TEXT_MASK) { - case INLINE_ALIGN_TO_TOP: { + switch (E.value.inline_align & INLINE_ALIGNMENT_TEXT_MASK) { + case INLINE_ALIGNMENT_TO_TOP: { E.value.rect.position.y = -sd->ascent; } break; - case INLINE_ALIGN_TO_CENTER: { + case INLINE_ALIGNMENT_TO_CENTER: { E.value.rect.position.y = (-sd->ascent + sd->descent) / 2; } break; - case INLINE_ALIGN_TO_BASELINE: { + case INLINE_ALIGNMENT_TO_BASELINE: { E.value.rect.position.y = 0; } break; - case INLINE_ALIGN_TO_BOTTOM: { + case INLINE_ALIGNMENT_TO_BOTTOM: { E.value.rect.position.y = sd->descent; } break; } - switch (E.value.inline_align & INLINE_ALIGN_IMAGE_MASK) { - case INLINE_ALIGN_BOTTOM_TO: { + switch (E.value.inline_align & INLINE_ALIGNMENT_IMAGE_MASK) { + case INLINE_ALIGNMENT_BOTTOM_TO: { E.value.rect.position.y -= E.value.rect.size.y; } break; - case INLINE_ALIGN_CENTER_TO: { + case INLINE_ALIGNMENT_CENTER_TO: { E.value.rect.position.y -= E.value.rect.size.y / 2; } break; - case INLINE_ALIGN_TOP_TO: { + case INLINE_ALIGNMENT_TOP_TO: { // NOP } break; } full_ascent = MAX(full_ascent, -E.value.rect.position.y); full_descent = MAX(full_descent, E.value.rect.position.y + E.value.rect.size.y); } else { - switch (E.value.inline_align & INLINE_ALIGN_TEXT_MASK) { - case INLINE_ALIGN_TO_TOP: { + switch (E.value.inline_align & INLINE_ALIGNMENT_TEXT_MASK) { + case INLINE_ALIGNMENT_TO_TOP: { E.value.rect.position.x = -sd->ascent; } break; - case INLINE_ALIGN_TO_CENTER: { + case INLINE_ALIGNMENT_TO_CENTER: { E.value.rect.position.x = (-sd->ascent + sd->descent) / 2; } break; - case INLINE_ALIGN_TO_BASELINE: { + case INLINE_ALIGNMENT_TO_BASELINE: { E.value.rect.position.x = 0; } break; - case INLINE_ALIGN_TO_BOTTOM: { + case INLINE_ALIGNMENT_TO_BOTTOM: { E.value.rect.position.x = sd->descent; } break; } - switch (E.value.inline_align & INLINE_ALIGN_IMAGE_MASK) { - case INLINE_ALIGN_BOTTOM_TO: { + switch (E.value.inline_align & INLINE_ALIGNMENT_IMAGE_MASK) { + case INLINE_ALIGNMENT_BOTTOM_TO: { E.value.rect.position.x -= E.value.rect.size.x; } break; - case INLINE_ALIGN_CENTER_TO: { + case INLINE_ALIGNMENT_CENTER_TO: { E.value.rect.position.x -= E.value.rect.size.x / 2; } break; - case INLINE_ALIGN_TOP_TO: { + case INLINE_ALIGNMENT_TOP_TO: { // NOP } break; } diff --git a/modules/text_server_fb/text_server_fb.h b/modules/text_server_fb/text_server_fb.h index 67b08d1eac..f2b33c2afb 100644 --- a/modules/text_server_fb/text_server_fb.h +++ b/modules/text_server_fb/text_server_fb.h @@ -387,8 +387,8 @@ public: virtual bool shaped_text_get_preserve_control(RID p_shaped) const override; virtual bool shaped_text_add_string(RID p_shaped, const String &p_text, const Vector<RID> &p_fonts, int p_size, const Dictionary &p_opentype_features = Dictionary(), const String &p_language = "") override; - virtual bool shaped_text_add_object(RID p_shaped, Variant p_key, const Size2 &p_size, InlineAlign p_inline_align = INLINE_ALIGN_CENTER, int p_length = 1) override; - virtual bool shaped_text_resize_object(RID p_shaped, Variant p_key, const Size2 &p_size, InlineAlign p_inline_align = INLINE_ALIGN_CENTER) override; + virtual bool shaped_text_add_object(RID p_shaped, Variant p_key, const Size2 &p_size, InlineAlignment p_inline_align = INLINE_ALIGNMENT_CENTER, int p_length = 1) override; + virtual bool shaped_text_resize_object(RID p_shaped, Variant p_key, const Size2 &p_size, InlineAlignment p_inline_align = INLINE_ALIGNMENT_CENTER) override; virtual RID shaped_text_substr(RID p_shaped, int p_start, int p_length) const override; virtual RID shaped_text_get_parent(RID p_shaped) const override; diff --git a/modules/visual_script/editor/visual_script_editor.cpp b/modules/visual_script/editor/visual_script_editor.cpp index 349537521c..75a1980ede 100644 --- a/modules/visual_script/editor/visual_script_editor.cpp +++ b/modules/visual_script/editor/visual_script_editor.cpp @@ -779,7 +779,7 @@ void VisualScriptEditor::_update_graph(int p_only_id) { for (int i = 0; i < node->get_output_sequence_port_count(); i++) { Label *text2 = memnew(Label); text2->set_text(node->get_output_sequence_port_text(i)); - text2->set_align(Label::ALIGN_RIGHT); + text2->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_RIGHT); gnode->add_child(text2); gnode->set_slot(slot_idx, false, 0, Color(), true, TYPE_SEQUENCE, mono_color, seq_port, seq_port); slot_idx++; @@ -900,7 +900,7 @@ void VisualScriptEditor::_update_graph(int p_only_id) { if (i < mixed_seq_ports) { Label *text2 = memnew(Label); text2->set_text(node->get_output_sequence_port_text(i)); - text2->set_align(Label::ALIGN_RIGHT); + text2->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_RIGHT); hbc->add_child(text2); } @@ -4476,8 +4476,8 @@ VisualScriptEditor::VisualScriptEditor() { select_func_text = memnew(Label); select_func_text->set_text(TTR("Select or create a function to edit its graph.")); - select_func_text->set_align(Label::ALIGN_CENTER); - select_func_text->set_valign(Label::VALIGN_CENTER); + select_func_text->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER); + select_func_text->set_vertical_alignment(VERTICAL_ALIGNMENT_CENTER); select_func_text->set_h_size_flags(SIZE_EXPAND_FILL); add_child(select_func_text); @@ -4485,8 +4485,8 @@ VisualScriptEditor::VisualScriptEditor() { hint_text->set_anchor_and_offset(SIDE_TOP, ANCHOR_END, -100); hint_text->set_anchor_and_offset(SIDE_BOTTOM, ANCHOR_END, 0); hint_text->set_anchor_and_offset(SIDE_RIGHT, ANCHOR_END, 0); - hint_text->set_align(Label::ALIGN_CENTER); - hint_text->set_valign(Label::VALIGN_CENTER); + hint_text->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER); + hint_text->set_vertical_alignment(VERTICAL_ALIGNMENT_CENTER); graph->add_child(hint_text); hint_text_timer = memnew(Timer); |