Closed clayjohn closed 2 days ago
Hi!
I'd be interested in trying to fix this issue. I'm not sure if you've already started working on it, but if you haven't and you don't want to, I'd like to take a crack at it.
I don't plan on working on this, so go ahead!
I think the simplest way to fix this issue would be to just check if the number ends with a .0 and if so remove it. I just added a few lines to EditorPerformanceProfiler::_create_label which do this:
default: {
String ret = TS->format_number(rtos(p_value));
if (ret.ends_with(".0")) {
ret = ret.pad_decimals(0);
}
return ret;
}
This fixes the issue of integers as floats in the Monitor:
By the way, I don't see how it's a flaw that get_monitor() returns a double. In 4.3 it returned a double but we didn't see the trailing ".0". Anyway, I'll probably create a pull request for this in a bit.
This was already reported in:
Closing as a duplicate of https://github.com/godotengine/godot/issues/99000
Tested versions
System information
M2 Macbook
Issue description
Values that are always integers are being reported as floats in the editor monitor.
This is technically a regression from https://github.com/godotengine/godot/pull/47502
However, https://github.com/godotengine/godot/pull/47502 just exposed an underlying flaw in the monitor system:
get_monitor()
always returns a doublehttps://github.com/godotengine/godot/blob/0c45ace151f25de2ca54fe7a46b6f077be32ba6f/main/performance.cpp#L159
Steps to reproduce
Just look in the monitors tab
Minimal reproduction project (MRP)
N/A - this is native to the Godot editor itself