summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/variant_call.cpp2
-rw-r--r--doc/classes/String.xml9
-rw-r--r--modules/bullet/godot_result_callbacks.cpp1
-rw-r--r--modules/mono/glue/Managed/Files/Colors.cs2
-rw-r--r--scene/gui/text_edit.cpp17
5 files changed, 24 insertions, 7 deletions
diff --git a/core/variant_call.cpp b/core/variant_call.cpp
index 0c6e43fe36..aa180cd4ac 100644
--- a/core/variant_call.cpp
+++ b/core/variant_call.cpp
@@ -291,6 +291,7 @@ struct _VariantCall {
VCALL_LOCALMEM0R(String, is_valid_identifier);
VCALL_LOCALMEM0R(String, is_valid_integer);
VCALL_LOCALMEM0R(String, is_valid_float);
+ VCALL_LOCALMEM1R(String, is_valid_hex_number);
VCALL_LOCALMEM0R(String, is_valid_html_color);
VCALL_LOCALMEM0R(String, is_valid_ip_address);
VCALL_LOCALMEM0R(String, to_int);
@@ -1534,6 +1535,7 @@ void register_variant_methods() {
ADDFUNC0R(STRING, BOOL, String, is_valid_identifier, varray());
ADDFUNC0R(STRING, BOOL, String, is_valid_integer, varray());
ADDFUNC0R(STRING, BOOL, String, is_valid_float, varray());
+ ADDFUNC1R(STRING, BOOL, String, is_valid_hex_number, BOOL, "with_prefix", varray(false));
ADDFUNC0R(STRING, BOOL, String, is_valid_html_color, varray());
ADDFUNC0R(STRING, BOOL, String, is_valid_ip_address, varray());
ADDFUNC0R(STRING, INT, String, to_int, varray());
diff --git a/doc/classes/String.xml b/doc/classes/String.xml
index 536165487d..dbef84fc15 100644
--- a/doc/classes/String.xml
+++ b/doc/classes/String.xml
@@ -439,6 +439,15 @@
Returns [code]true[/code] if this string contains a valid float.
</description>
</method>
+ <method name="is_valid_hex_number">
+ <return type="bool">
+ </return>
+ <argument index="0" name="with_prefix" type="bool" default="False">
+ </argument>
+ <description>
+ Returns [code]true[/code] if this string contains a valid hexadecimal number. If [code]with_prefix[/code] is [code]true[/code], then a validity of the hexadecimal number is determined by [code]0x[/code] prefix, for instance: [code]0xDEADC0DE[/code].
+ </description>
+ </method>
<method name="is_valid_html_color">
<return type="bool">
</return>
diff --git a/modules/bullet/godot_result_callbacks.cpp b/modules/bullet/godot_result_callbacks.cpp
index 0117bb375f..3dc9f3fce5 100644
--- a/modules/bullet/godot_result_callbacks.cpp
+++ b/modules/bullet/godot_result_callbacks.cpp
@@ -304,6 +304,7 @@ btScalar GodotRestInfoContactResultCallback::addSingleResult(btManifoldPoint &cp
colObj = static_cast<CollisionObjectBullet *>(colObj1Wrap->getCollisionObject()->getUserPointer());
m_result->shape = cp.m_index1;
B_TO_G(cp.getPositionWorldOnB(), m_result->point);
+ B_TO_G(cp.m_normalWorldOnB, m_result->normal);
m_rest_info_bt_point = cp.getPositionWorldOnB();
m_rest_info_collision_object = colObj1Wrap->getCollisionObject();
} else {
diff --git a/modules/mono/glue/Managed/Files/Colors.cs b/modules/mono/glue/Managed/Files/Colors.cs
index 942375b0fe..bc2a1a3bd7 100644
--- a/modules/mono/glue/Managed/Files/Colors.cs
+++ b/modules/mono/glue/Managed/Files/Colors.cs
@@ -8,7 +8,7 @@ namespace Godot
// Color names and values are derived from core/color_names.inc
internal static readonly Dictionary<string, Color> namedColors = new Dictionary<string, Color> {
{"aliceblue", new Color(0.94f, 0.97f, 1.00f)},
- {"antiqueWhite", new Color(0.98f, 0.92f, 0.84f)},
+ {"antiquewhite", new Color(0.98f, 0.92f, 0.84f)},
{"aqua", new Color(0.00f, 1.00f, 1.00f)},
{"aquamarine", new Color(0.50f, 1.00f, 0.83f)},
{"azure", new Color(0.94f, 1.00f, 1.00f)},
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index b1849b7e69..003b30e035 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -1108,9 +1108,10 @@ void TextEdit::_notification(int p_what) {
if (cursor.column == last_wrap_column + j && cursor.line == line && cursor_wrap_index == line_wrap_index) {
cursor_pos = Point2i(char_ofs + char_margin + ofs_x, ofs_y);
+ cursor_pos.y += (get_row_height() - cache.font->get_height()) / 2;
if (insert_mode) {
- cursor_pos.y += (get_row_height() - 3);
+ cursor_pos.y += (cache.font->get_height() - 3);
}
int caret_w = (str[j] == '\t') ? cache.font->get_char_size(' ').width : char_w;
@@ -1155,7 +1156,8 @@ void TextEdit::_notification(int p_what) {
#else
caret_w = (block_caret) ? caret_w : 2;
#endif
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(cursor_pos, Size2i(caret_w, get_row_height())), cache.caret_color);
+
+ VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(cursor_pos, Size2i(caret_w, cache.font->get_height())), cache.caret_color);
}
}
}
@@ -1198,9 +1200,10 @@ void TextEdit::_notification(int p_what) {
if (cursor.column == last_wrap_column + str.length() && cursor.line == line && cursor_wrap_index == line_wrap_index && (char_ofs + char_margin) >= xmargin_beg) {
cursor_pos = Point2i(char_ofs + char_margin + ofs_x, ofs_y);
+ cursor_pos.y += (get_row_height() - cache.font->get_height()) / 2;
if (insert_mode) {
- cursor_pos.y += (get_row_height() - 3);
+ cursor_pos.y += (cache.font->get_height() - 3);
}
if (ime_text.length() > 0) {
int ofs = 0;
@@ -1245,7 +1248,8 @@ void TextEdit::_notification(int p_what) {
#else
int caret_w = (block_caret) ? char_w : 2;
#endif
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(cursor_pos, Size2i(caret_w, get_row_height())), cache.caret_color);
+
+ VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(cursor_pos, Size2i(caret_w, cache.font->get_height())), cache.caret_color);
}
}
}
@@ -1289,7 +1293,7 @@ void TextEdit::_notification(int p_what) {
if (cursor_pos.y + get_row_height() + th > get_size().height) {
completion_rect.position.y = cursor_pos.y - th;
} else {
- completion_rect.position.y = cursor_pos.y + get_row_height() + csb->get_offset().y;
+ completion_rect.position.y = cursor_pos.y + get_row_height() + csb->get_offset().y - cache.font->get_height();
completion_below = true;
}
@@ -1323,7 +1327,8 @@ void TextEdit::_notification(int p_what) {
text_color = color_regions[j].color;
}
}
- draw_string(cache.font, Point2(completion_rect.position.x, completion_rect.position.y + i * get_row_height() + cache.font->get_ascent()), completion_options[l], text_color, completion_rect.size.width);
+ int yofs = (get_row_height() - cache.font->get_height()) / 2;
+ draw_string(cache.font, Point2(completion_rect.position.x, completion_rect.position.y + i * get_row_height() + cache.font->get_ascent() + yofs), completion_options[l], text_color, completion_rect.size.width);
}
if (scrollw) {