• Type: New Feature New Feature
    • Status: Closed
    • Priority: Important Important
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.31 Beta 1
    • Labels:


      Atm we provide Lua functions:

      • GetTextHeightExact()
      • GetTextWidth()

      The GetTextHeightExact() API is unnecessary complex. It provides two parameters: textwidth and wordwrap. If wordwrap is set to false, it calculates the required text height for a single line and ignores the passed textwidth parameter. If textwidth is 0, it behaves as if wordwrap would have been set to false (regardless of what the parameter is actually set to).
      Both is not obvious from the API directly.

      The second flaw is the naming in that on the one side we provide GetTextWidth() to calculate the text width but suffix the corresponding text-height-calculation with the word: Exact (which is confusing since there's no "none-exact" variant available). Also it's completely unclear to the user what "exact" means in this regards.

      Last but not least we want to provide FFI functions for everything, since they are superior with regards to performance.

      To solve all of this, we'd introduce two new functions FFI functions:

      • GetTextHeight()
      • GetTextWidth()
        with the GetTextWidth() dropping the wordwrap bool parameter we use(d) in GetTextWidthExact() and replace the textwidth parameter with wordwrapwidth to make it self-explainatory what the parameter actually means/is used for.


        There are no comments yet on this issue.


          • Assignee:
            Stefan Hett
            Stefan Hett
          • Votes:
            0 Vote for this issue
            0 Start watching this issue


            • Created: