Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix nk_edit_string cursor #57

Merged
merged 1 commit into from
Jan 9, 2024
Merged

Commits on Jan 9, 2024

  1. Fix nk_edit_string cursor

    RayLib seems to only measure the spacing *between* glyphs:
    
    https://github.com/raysan5/raylib/blob/master/src/rtext.c#L1295
    
    While Nuklear iterates over each glyph from the edit_string when
    trying to calculate the cursor position calling the width function for
    each char of the input:
    
    https://github.com/vurtun/nuklear/blob/master/src/nuklear_util.c#L1105
    
    That means we need to add one additional spacing when returning the
    width to compensate for the missing spacing from RayLib.
    mhcerri committed Jan 9, 2024
    Configuration menu
    Copy the full SHA
    e7c6c96 View commit details
    Browse the repository at this point in the history