Remove useless scale from text HUD element documentation#17151
Conversation
cx384
left a comment
There was a problem hiding this comment.
Even after considering @SmallJoker’s comments in #17029, I still have not managed to find any HUD definition where
scalechanges anything. So I assume it really does nothing, as I suspected.
Indeed, scale does not change anything, because for the draw call hcenter and vcenter is false. So only the UpperLeftCorner of the position is relevant which does not get changed by scale.
Please also remove it in the cpp code to avoid confusion e.g. apply this:
0001-Remove-text-hud-scale-in-hud.cpp.patch
|
Wait a minute … I just realized something when looking at the code.
and here: According to the Irrlicht documentation, when you add a
https://irrlicht.sourceforge.io/docu/classirr_1_1core_1_1rect.html#a699b98aff4bf8b7d92cef6d3c940354f I interpret that the rectangle origin position is shifted by pos. Since this position (of I will therefore remove |
Please test the PR because it now contains a code change. (works on my machine) By the way: The Probably too late/risky for 5.16.0 tho. |
cx384
left a comment
There was a problem hiding this comment.
I interpret that the rectangle origin position is shifted by pos. Since this position (of
size) is always(0,0), this is a no-op. This explains why the scale setting does nothing.
No, it gets added to both UpperLeftCorner and LowerRightCorner see:
Lines 60 to 65 in bb7fcd3
I will therefore remove
sizeentirely, as it's essentially dead code.
Yes, as I wrote before, only the UpperLeftCorner is relevant in our draw calls, but this is only because hcenter and vcenter is false. See
luanti/src/irrlicht_changes/CGUITTFont.cpp
Line 582 in bb7fcd3
luanti/src/irrlicht_changes/CGUITTFont.cpp
Line 622 in bb7fcd3
Lines 319 to 323 in bb7fcd3
Line 351 in bb7fcd3
4e862a7 to
745c035
Compare
|
I’ve updated this PR by just re-applying the original suggested patch again. |
745c035 to
a4fab8c
Compare
|
Done. |
Fixes #17029.
The
scalefield is removed from the documentation for text HUD elements because this field appears to do absolutely nothing after various tests.Even after considering @SmallJoker’s comments in #17029, I still have not managed to find any HUD definition where
scalechanges anything. So I assume it really does nothing, as I suspected.If the intention of
scalewas to clip text out of a bounding box, it is not working as promised, so the documentation should not claim it anymore.This documentation can always be added back later if some functional bounding box feature is added.
NEW CHANGE: Additionally, an useless
sizevariable inhud.cppwas removed.To do
This PR is ready for review.
How to test
Read the changed files.
Test if HUD text still works.