-
Notifications
You must be signed in to change notification settings - Fork 250
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
Issue457: Fractional Scaling on Windows #524
Open
ptorngren
wants to merge
52
commits into
bobbylight:master
Choose a base branch
from
dbvis:issue-457-fractional-scaling-Windows
base: master
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Issue457: Fractional Scaling on Windows #524
ptorngren
wants to merge
52
commits into
bobbylight:master
from
dbvis:issue-457-fractional-scaling-Windows
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Add SwingUtils with methods for leveraging the FPAPI - Modify DefaultTokenPainter and VisibleWhitespaceTokenPainter to call SwingUtils
- set tabsize 4 in DemoRootPane (to match text sample) - fix bug in SwingUtils.charWidth(...) - modify SyntaxView to use floats for calculating tab stops: - SyntaxView.tabSize is now float - SyntaxView.calculateLongestLine() now calls SwingUtils.charWidth() - SyntaxView.nextTabStop() adapted for float tabSize
…hts and positions. Modify concerned classes and methods to use Rectangle2D and float variables instead of Rectangle and integers: - DefaultTokenPainter.paintBackground() - RSyntaxUtilities.getLineWidthUpTo() - SyntaxView: tabBase, clipStart, clipEnd, lineToRect(), damageLineRange(), modelToView(), paint() - Token.listOffsetToView() - TokenImpl.getWidthUpTo() now calls SwingUtils.charsWidth() - TokenImpl.listOffsetToView() - WrappedSyntaxView.modelToView()
… as the preceding character ends
…rily to avoid double lines on thick vertical line style NOTE: ConfigurableCaret.damage() still runs on integers as a result of superclass implementation. No negative effects have been observed.
…instead of float)
…ics when graphic properties change
…() to use FPAPI Refactor: move code from ConfigurableCaret.paint() to SwingUtils.drawLine()
…D and float/double variables
…corresponding elements for Java 9 or later Rectangles and bounds: - add SwingUtils.getBounds() to wrap calls to modelToView2D(pos).getBounds() in a null-safe way - replace calls to JTextComponent.modelToView(int pos) with calls to SwingUtils.getBounds(JTextComponent c, int pos) - replace calls to JTextComponent.viewToModel(Point p) with calls to JTextComponent.viewToModel2D(Point2D p) Events: - replace calls to InputEvent.getModifiers() with calls to MouseEvent.getModifiersEx() - replace calls to Toolkit.getMenuShortcutKeyMask() Toolkit.getMenuShortcutKeyMaskEx() - replace references to Event.META_MASK with InputEvent.META_DOWN_MASK - replace references to Event.CTRL_MASK with InputEvent.CTRL_DOWN_MASK - replace references to MouseEvent.BUTTON1_MASK with MouseEvent.BUTTON1_DOWN_MASK Not modified: - SyntaxScheme calls deprecated XMLReaderFactory.createXMLReader() which should be replaced with SaxParserFactory
…l-scaling-Windows
…xUtilities.isMonospaced(Font).
…inspired by SwingUtilities2)
- Add SwingUtils with methods for leveraging the FPAPI - Modify DefaultTokenPainter and VisibleWhitespaceTokenPainter to call SwingUtils
- set tabsize 4 in DemoRootPane (to match text sample) - fix bug in SwingUtils.charWidth(...) - modify SyntaxView to use floats for calculating tab stops: - SyntaxView.tabSize is now float - SyntaxView.calculateLongestLine() now calls SwingUtils.charWidth() - SyntaxView.nextTabStop() adapted for float tabSize
…hts and positions. Modify concerned classes and methods to use Rectangle2D and float variables instead of Rectangle and integers: - DefaultTokenPainter.paintBackground() - RSyntaxUtilities.getLineWidthUpTo() - SyntaxView: tabBase, clipStart, clipEnd, lineToRect(), damageLineRange(), modelToView(), paint() - Token.listOffsetToView() - TokenImpl.getWidthUpTo() now calls SwingUtils.charsWidth() - TokenImpl.listOffsetToView() - WrappedSyntaxView.modelToView()
… as the preceding character ends
…rily to avoid double lines on thick vertical line style NOTE: ConfigurableCaret.damage() still runs on integers as a result of superclass implementation. No negative effects have been observed.
…instead of float)
…ics when graphic properties change
…() to use FPAPI Refactor: move code from ConfigurableCaret.paint() to SwingUtils.drawLine()
…D and float/double variables
…corresponding elements for Java 9 or later Rectangles and bounds: - add SwingUtils.getBounds() to wrap calls to modelToView2D(pos).getBounds() in a null-safe way - replace calls to JTextComponent.modelToView(int pos) with calls to SwingUtils.getBounds(JTextComponent c, int pos) - replace calls to JTextComponent.viewToModel(Point p) with calls to JTextComponent.viewToModel2D(Point2D p) Events: - replace calls to InputEvent.getModifiers() with calls to MouseEvent.getModifiersEx() - replace calls to Toolkit.getMenuShortcutKeyMask() Toolkit.getMenuShortcutKeyMaskEx() - replace references to Event.META_MASK with InputEvent.META_DOWN_MASK - replace references to Event.CTRL_MASK with InputEvent.CTRL_DOWN_MASK - replace references to MouseEvent.BUTTON1_MASK with MouseEvent.BUTTON1_DOWN_MASK Not modified: - SyntaxScheme calls deprecated XMLReaderFactory.createXMLReader() which should be replaced with SaxParserFactory
…xUtilities.isMonospaced(Font).
…inspired by SwingUtilities2)
…dows' into issue-457-fractional-scaling-Windows # Conflicts: # RSyntaxTextArea/src/main/java/org/fife/ui/rsyntaxtextarea/DefaultTokenPainter.java # RSyntaxTextArea/src/main/java/org/fife/ui/rsyntaxtextarea/SyntaxView.java
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add support for FPAPI: Add new class SwingUtils with methods for leveraging the FPAPI
Modify concerned classes and methods to call SwingUtils and use Rectangle2D and float/double variables instead of Rectangle and integers:
Layout/painter changes:
Adapt to Java 11: Replace calls to deprecated elements with corresponding elements for Java 9 or later
Rectangles and bounds:
Events:
Also modified the Demo Root Pane: