Use float for TextEdit horizontal margins #114221
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
StyleBoxmargins issues when stored with precision. #110791This makes TextEdit (and CodeEdit) use floats for left and right content margins.
This doesn't affect the top and bottom ones since there isn't an issue with them currently and other controls that draw text seem to snap text to integers anyway.
Changes
get_line_column_at_posto accept Vector2 instead of Vector2i since it is used with the mouse position which is a Vector2.The
h_scrollfunctions now uses double to pass to the scrollbar, like thev_scrollones.Also changed some of the minimap horizontal mouse checks to be consistent so the hover and click detection matches the cursor.
Note that TextEdit still has lots of issues in rtl layout mode, but the specific case in #105827 where the stylebox left and right margins were equal and ended with .5 or greater is fine.
This is easier to test with #114217