You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I was testing my debug_draw_3d extension, I noticed that the graph titles change their size strangely.
For example, here, with a font size of 41 for one of the titles, instead of fps5 it draws fps6 with a font size of 14.
But the ascent of the font is taken correctly, which is why the title goes down a lot.
I found that these hashing functions create the same hash for fps5: 41, fps6: 14 and fps8: 76.
Godot version
v4.0.beta10.official [d0398f6]
System information
Windows 10, Vulkan
Issue description
When I was testing my
debug_draw_3d
extension, I noticed that the graph titles change their size strangely.For example, here, with a font size of 41 for one of the titles, instead of
fps5
it drawsfps6
with a font size of 14.But the ascent of the font is taken correctly, which is why the title goes down a lot.
I found that these hashing functions create the same hash for
fps5: 41
,fps6: 14
andfps8: 76
.godot/scene/resources/font.cpp
Lines 273 to 291 in f7cf9fb
godot/scene/resources/font.cpp
Lines 303 to 323 in f7cf9fb
(also both of these parts of the code are repeated 3 times)
Here's what I get in MRP:
Expected something like this:
Affected
Font
methods:get_string_size
,get_multiline_string_size
,draw_string
,draw_multiline_string
,draw_string_outline
,draw_multiline_string_outline
.Steps to reproduce
second_font_size
parameter and watch glitches on some values.Also, if you cache a lot of variants for
second_font_size
, and then changefirst_font_size
(or vice versa), then there will be a more glitches:Minimal reproduction project
Font Bad Hash.zip
The text was updated successfully, but these errors were encountered: