Uploaded image for project: 'NetBeans'
  1. NetBeans
  2. NETBEANS-4166

Review likely inaccurate int-based character width calculations in editor UI

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 11.3
    • None
    • Windows and MacOS with HiDPI/retina displays, Java 9 and above

    Description

      While fixing NETBEANS-346, I discovered several other editor painting coordinate calculations which are likely inaccurate due to rounding errors. Fixing these will be a bit of work, though, and it may be preferable to wait until specific bugs are identified before doing so, so that the changes can be verified to have had the desired effect.

      The following members should likely be changed from an int to a float, and initialized from font metrics to full precision:

      • org.netbeans.editor.EditorUI.defaultSpaceWidth
      • org.netbeans.modules.editor.lib.drawing.DrawEngine.spaceWidth, defaultSpaceWidth, and possibly fragmentWidth
      • org.netbeans.modules.editor.lib.drawing.DrawGraphics.defaultSpaceWidth

      Changing these from int to float will require various other methods and members to be updated as well.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              ebakke Eirik Bakke
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: