-
Notifications
You must be signed in to change notification settings - Fork 226
Fix caret of raw insert mode of text editor on HiDPI screens #3230
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for proposing this fix! I have one question regarding the proposed solution, as it appears more complex to me than required.
|
||
return bracketImage; | ||
int height= styledText.getLineHeight(); | ||
return new Image(styledText.getDisplay(), new ImageDataProvider() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any reason to use an ImageDataProvider
rather than an ImageGcDrawer
?
This requires to manually implement proper line width calculation and line rendering instead of just using gc.drawLine()
like in the original code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This creates a 1-bit image as before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean with "1-bit image"? Do you mean that the line is 1 pixel wide? That's the intended behavior of setLineWidth(0)
. Changing that to setLineWidth(1)
should resolve it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1-bit image = image with 1-bit color palette = a pixels uses 1-bit = colloquially called black-and-white image
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. But is it really necessary/beneficial to keep it like that?
Fixes: #3010