Menu

#2118 Tabbed text alignment on highest levels of zoom out

Bug
closed-fixed
nobody
5
2019-10-24
2019-07-02
Larry H
No

Platform: Notepad++ 7.7.1 on Windows 10

In the Document Map and at the highest 3 levels of zoom out (Doc Map is just a zoomed out view) the alignment of text containing tabs is no longer correct. Some rows display an additional tab with no obvious pattern.

See attached image - the orange datatypes in this SQL script are all aligned with 4 character tabs. There are no other characters between the white field names and datatypes, just tabs.

1 Attachments

Discussion

  • Neil Hodgson

    Neil Hodgson - 2019-07-02
    • labels: Notepad++, Scintilla --> Notepad++, scintilla, layout
     
  • Neil Hodgson

    Neil Hodgson - 2019-07-02

    This could be a loss-of-precision or rounding to integer issue. One factor that could influence this is whether the view is using GDI (technology=0, integer widths) or DirectWrite (technology=1, floating point widths).

    You should attach the file that showed the issue.

     
  • Zufu Liu

    Zufu Liu - 2019-07-03

    I think it's mostly happens on GDI.
    The screenshot tested this file with DejaVu Sans Mono 11pt at 100%.
    https://github.com/zufuliu/notepad2/blob/master/src/Notepad2.rc

    Happens on D2D too when extremely zoomed out (<= 22%).

     

    Last edit: Zufu Liu 2019-07-03
  • Larry H

    Larry H - 2019-07-03

    Thanks for confirming Zufu Liu. Attaching a sample SQL script.

    Did consider if it was some sort of rounding or odd/even thing as on average half the lines are correct and half not.

     
    • Neil Hodgson

      Neil Hodgson - 2019-07-03

      This is caused by the minimum tab width which is set to 2 pixels. This ensures that tabs are always visible.

      For a document map where there is no need to see every detail, this value could be made changeable by the application with a new API.

      You can experiment by changing the value assigned to tabWidthMinimumPixels in the EditView constructor.

       
  • Zufu Liu

    Zufu Liu - 2019-07-04

    Set tabWidthMinimumPixels to 1 fixed the problem.

     
  • Neil Hodgson

    Neil Hodgson - 2019-07-05

    A proposed SCI_SETTABMINIMUMWIDTH API change set is attached. Includes a generic SetAppearance method.

     
  • Zufu Liu

    Zufu Liu - 2019-07-05

    Is this bug also affect printing?

    vsPrint.zoomLevel = printParameters.magnification;
    
     
    • Neil Hodgson

      Neil Hodgson - 2019-07-06

      Its possible but printers are commonly higher resolution than screens so less likely.

       
  • Neil Hodgson

    Neil Hodgson - 2019-07-10

    For the change to progress there needs to be confirmation that it works correctly in the target application.

     
  • Zufu Liu

    Zufu Liu - 2019-07-10

    It works. I found it only need to set when font size is smaller than 3.5pt.
    https://github.com/zufuliu/notepad2/commit/82c40f3252509d26a409293d69d3b54a4db8155e

     
    • Neil Hodgson

      Neil Hodgson - 2019-07-10

      The bug is against the document map in Notepad++, not Notepad2. What I want here is assurance that this change will actually be useful in the context of document maps (sometimes called mini-maps) and in particular, the patch is correct for the document map in Notepad++.

       
  • Zufu Liu

    Zufu Liu - 2019-07-11

    I don't know where to add SCI_SETTABMINIMUMWIDTH call in Notepad++, but build SciLexer.dll with hard-coded 1 for tabWidthMinimumPixels works.

     
    👍
    1
  • Neil Hodgson

    Neil Hodgson - 2019-10-02
    • status: open --> open-fixed
     
  • Neil Hodgson

    Neil Hodgson - 2019-10-02

    Committed new API as [ed73f7], [e6efe0].

     

    Related

    Commit: [e6efe0]
    Commit: [ed73f7]

  • Neil Hodgson

    Neil Hodgson - 2019-10-24
    • status: open-fixed --> closed-fixed
     
  • Neil Hodgson

    Neil Hodgson - 2019-10-24

    Committed new API as [ed73f7], [e6efe0].

     

    Related

    Commit: [e6efe0]
    Commit: [ed73f7]


Log in to post a comment.