summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/math/math_funcs.h4
-rw-r--r--doc/classes/@GDScript.xml6
-rw-r--r--editor/plugins/abstract_polygon_2d_editor.cpp4
-rw-r--r--editor/plugins/spatial_editor_plugin.cpp20
-rw-r--r--editor/plugins/spatial_editor_plugin.h1
-rw-r--r--scene/gui/texture_progress.cpp12
6 files changed, 28 insertions, 19 deletions
diff --git a/core/math/math_funcs.h b/core/math/math_funcs.h
index ea0bfd88cc..629002ced6 100644
--- a/core/math/math_funcs.h
+++ b/core/math/math_funcs.h
@@ -242,8 +242,8 @@ public:
static void randomize();
static uint32_t rand_from_seed(uint64_t *seed);
static uint32_t rand();
- static _ALWAYS_INLINE_ double randf() { return (double)rand() / (double)Math::RANDOM_MAX; }
- static _ALWAYS_INLINE_ float randd() { return (float)rand() / (float)Math::RANDOM_MAX; }
+ static _ALWAYS_INLINE_ double randd() { return (double)rand() / (double)Math::RANDOM_MAX; }
+ static _ALWAYS_INLINE_ float randf() { return (float)rand() / (float)Math::RANDOM_MAX; }
static double random(double from, double to);
static float random(float from, float to);
diff --git a/doc/classes/@GDScript.xml b/doc/classes/@GDScript.xml
index 072eec800f..b56e5bf8e7 100644
--- a/doc/classes/@GDScript.xml
+++ b/doc/classes/@GDScript.xml
@@ -809,7 +809,7 @@
<argument index="1" name="to" type="float">
</argument>
<description>
- Random range, any floating point value between [code]from[/code] and [code]to[/code].
+ Random range, any floating point value in the interval [[code]from[/code], [code]to[/code]].
[codeblock]
prints(rand_range(0, 1), rand_range(0, 1)) # prints 0.135591 0.405263
[/codeblock]
@@ -828,7 +828,7 @@
<return type="float">
</return>
<description>
- Returns a random floating point value between 0 and 1.
+ Returns a random floating point value on the interval [0, 1].
[codeblock]
randf() # returns 0.375671
[/codeblock]
@@ -838,7 +838,7 @@
<return type="int">
</return>
<description>
- Returns a random 32 bit integer. Use remainder to obtain a random value between 0 and N (where N is smaller than 2^32 -1).
+ Returns a random 32 bit integer. Use remainder to obtain a random value in the interval [0, N] (where N is smaller than 2^32 -1).
[codeblock]
randi() % 20 # returns random number between 0 and 19
randi() % 100 # returns random number between 0 and 99
diff --git a/editor/plugins/abstract_polygon_2d_editor.cpp b/editor/plugins/abstract_polygon_2d_editor.cpp
index 82cd9e84dd..5a62f0da4e 100644
--- a/editor/plugins/abstract_polygon_2d_editor.cpp
+++ b/editor/plugins/abstract_polygon_2d_editor.cpp
@@ -201,6 +201,8 @@ void AbstractPolygon2DEditor::_notification(int p_what) {
case NOTIFICATION_READY: {
+ disable_polygon_editing(false, String());
+
button_create->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("CurveCreate", "EditorIcons"));
button_edit->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("CurveEdit", "EditorIcons"));
button_delete->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("CurveDelete", "EditorIcons"));
@@ -797,8 +799,6 @@ AbstractPolygon2DEditor::AbstractPolygon2DEditor(EditorNode *p_editor, bool p_wi
selected_point = Vertex();
edge_point = PosVertex();
- disable_polygon_editing(false, String());
-
add_child(memnew(VSeparator));
button_create = memnew(ToolButton);
add_child(button_create);
diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp
index 0704e57bb9..41666f1082 100644
--- a/editor/plugins/spatial_editor_plugin.cpp
+++ b/editor/plugins/spatial_editor_plugin.cpp
@@ -4856,6 +4856,13 @@ void SpatialEditor::_update_gizmos_menu() {
}
}
+void SpatialEditor::_update_gizmos_menu_theme() {
+ for (int i = 0; i < gizmo_plugins.size(); ++i) {
+ if (!gizmo_plugins[i]->can_be_hidden()) continue;
+ gizmos_menu->set_item_icon(gizmos_menu->get_item_index(i), gizmos_menu->get_icon("visibility_visible"));
+ }
+}
+
void SpatialEditor::_init_grid() {
PoolVector<Color> grid_colors[3];
@@ -5145,20 +5152,17 @@ void SpatialEditor::_notification(int p_what) {
get_tree()->connect("node_removed", this, "_node_removed");
EditorNode::get_singleton()->get_scene_tree_dock()->get_tree_editor()->connect("node_changed", this, "_refresh_menu_icons");
editor_selection->connect("selection_changed", this, "_refresh_menu_icons");
- }
-
- if (p_what == NOTIFICATION_ENTER_TREE) {
+ } else if (p_what == NOTIFICATION_ENTER_TREE) {
_register_all_gizmos();
_update_gizmos_menu();
_init_indicators();
- }
-
- if (p_what == NOTIFICATION_EXIT_TREE) {
+ } else if (p_what == NOTIFICATION_THEME_CHANGED) {
+ _update_gizmos_menu_theme();
+ } else if (p_what == NOTIFICATION_EXIT_TREE) {
_finish_indicators();
- }
- if (p_what == EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) {
+ } else if (p_what == EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) {
tool_button[SpatialEditor::TOOL_MODE_SELECT]->set_icon(get_icon("ToolSelect", "EditorIcons"));
tool_button[SpatialEditor::TOOL_MODE_MOVE]->set_icon(get_icon("ToolMove", "EditorIcons"));
tool_button[SpatialEditor::TOOL_MODE_ROTATE]->set_icon(get_icon("ToolRotate", "EditorIcons"));
diff --git a/editor/plugins/spatial_editor_plugin.h b/editor/plugins/spatial_editor_plugin.h
index 2dc627cb27..364b0085f7 100644
--- a/editor/plugins/spatial_editor_plugin.h
+++ b/editor/plugins/spatial_editor_plugin.h
@@ -618,6 +618,7 @@ private:
void _instance_scene();
void _init_indicators();
void _update_gizmos_menu();
+ void _update_gizmos_menu_theme();
void _init_grid();
void _finish_indicators();
void _finish_grid();
diff --git a/scene/gui/texture_progress.cpp b/scene/gui/texture_progress.cpp
index 778d86d546..bf6a5d30bf 100644
--- a/scene/gui/texture_progress.cpp
+++ b/scene/gui/texture_progress.cpp
@@ -160,23 +160,27 @@ Point2 TextureProgress::unit_val_to_uv(float val) {
if (edge == 0) {
if (dir.x > 0)
continue;
- cp = -dir.x;
cq = -(edgeLeft - p.x);
+ dir.x *= 2.0 * cq;
+ cp = -dir.x;
} else if (edge == 1) {
if (dir.x < 0)
continue;
- cp = dir.x;
cq = (edgeRight - p.x);
+ dir.x *= 2.0 * cq;
+ cp = dir.x;
} else if (edge == 2) {
if (dir.y > 0)
continue;
- cp = -dir.y;
cq = -(edgeBottom - p.y);
+ dir.y *= 2.0 * cq;
+ cp = -dir.y;
} else if (edge == 3) {
if (dir.y < 0)
continue;
- cp = dir.y;
cq = (edgeTop - p.y);
+ dir.y *= 2.0 * cq;
+ cp = dir.y;
}
cr = cq / cp;
if (cr >= 0 && cr < t1)