eclipse-platform / eclipse.platform.swt

Eclipse SWT
https://www.eclipse.org/swt/
Eclipse Public License 2.0
101 stars 123 forks source link

Cosmetic issues in rendering when 'line spacing' option is set #1286

Open sratz opened 2 weeks ago

sratz commented 2 weeks ago

Cosmetic issues when 'line spacing' is set under Preferences -> General -> Editors -> Text Editors -> Line spacing.

Line spacing 0:

image

image

image

Line spacing >0 (extreme value for demo purposes):

image

image

image

Compare VS Code:

image

image

To summarize:

When line spacing > 0 is enabled, there are several issues:

  1. The spacing is not symmetrical, the text is not centered
  2. The caret is not using the full row height.
  3. There exist some custom carets in https://github.com/eclipse-platform/eclipse.platform.ui/blob/954bc581051c3f0a5ebcacc1d85492d2acd85707/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractTextEditor.java#L6508-L6516 referring to issue https://bugs.eclipse.org/bugs/show_bug.cgi?id=118612 which needs to be addressed also.
  4. The text blue selection is not using the full row height.

1 and 2 can be fixed in StyledText / StyledTextRenderer. 3 in platform.ui. 4 I am not sure.