aboutsummaryrefslogtreecommitdiff
path: root/tools/editor/plugins/script_editor_plugin.cpp
diff options
context:
space:
mode:
authorRémi Verschelde2016-03-10 16:15:49 +0100
committerRémi Verschelde2016-03-10 16:15:49 +0100
commitaaad24e6fb1528fc6c773c0225ed9500c3fdd2bb (patch)
tree050800bfb1afbc562448967ee635834356c43af5 /tools/editor/plugins/script_editor_plugin.cpp
parent042f8bf88c331197b05e9b250b48ef3f5632b4fe (diff)
parent7b07bcaf449ea6cf52c2ac501e48cddbe4bde035 (diff)
downloadgodot-aaad24e6fb1528fc6c773c0225ed9500c3fdd2bb.tar.gz
godot-aaad24e6fb1528fc6c773c0225ed9500c3fdd2bb.tar.zst
godot-aaad24e6fb1528fc6c773c0225ed9500c3fdd2bb.zip
Merge pull request #3865 from Marqin/coverity
[Coverity] fixed 11 of 537 potential bugs found by Coverity
Diffstat (limited to '')
-rw-r--r--tools/editor/plugins/script_editor_plugin.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/editor/plugins/script_editor_plugin.cpp b/tools/editor/plugins/script_editor_plugin.cpp
index 2fb5dd619..76c64beb6 100644
--- a/tools/editor/plugins/script_editor_plugin.cpp
+++ b/tools/editor/plugins/script_editor_plugin.cpp
@@ -1784,7 +1784,8 @@ void ScriptEditor::_update_script_colors() {
if (h>hist_size) {
continue;
}
- float v = Math::ease((edit_pass-pass)/float(hist_size),0.4);
+ int non_zero_hist_size = ( hist_size == 0 ) ? 1 : hist_size;
+ float v = Math::ease((edit_pass-pass)/float(non_zero_hist_size),0.4);
script_list->set_item_custom_bg_color(i,hot_color.linear_interpolate(cold_color,v));
@@ -2704,4 +2705,3 @@ ScriptEditorPlugin::ScriptEditorPlugin(EditorNode *p_node) {
ScriptEditorPlugin::~ScriptEditorPlugin()
{
}
-