-
Notifications
You must be signed in to change notification settings - Fork 8
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
Improve scaling quality for files with many lines #24
Comments
fixed in 1.3.1 |
@nmatt: Try 1.3.1 and give me feedback https://github.com/markiewb/nb-codeoutline/releases/tag/v1.3.1 |
Strange. I will have a look. Perhaps I should disable anti-aliasing before scaling |
Yes it looks strange. I can reproduce it. There is some logic regarding height. If you like, you can debug it and fix it. |
Did you tried http://docs.oracle.com/javase/tutorial/2d/advanced/quality.html ? |
Ok, the way it is currently implemented, i.e. rendering the text at a very small size into a buffer with the same height as the target area, probably can't ever look right. This is because the text rendering logic will render the text line by line into the buffer, where each line has only a fractional pixel height. This can't possibly produce high-quality results. What needs to be done is to render the text into a much larger buffer, so that each text line is rendered with multiple pixels in height (preferably an integral (non-fractional) number of pixels to avoid aliasing differences between lines), and then scale this buffer down into the target graphics context. For very large files (10.000's of lines or more), this probably should be done in chunks to avoid out-of-memory due to buffer size. |
Perhaps that is the reason, why Sublime only shows font-size=1 lines? |
@p2rkw: Thanks for the note. It is already used - see https://github.com/markiewb/nb-codeoutline/blob/master/src/main/java/bluej/editor/moe/NaviView.java#L627 |
I won't invest time to fix this issue. I am not using this plugin that often. Thank you for your understanding. If you like to get it fixed, please provide a pullrequest! I would be happy to integrate it! The relevant source file is |
Currently (v1.3), text in different text lines appear to have a different height -- probably an artifact of the scaling algorithm used. It would be nice if the font size could be configured such that each text lines takes up an equal integral number of pixels in height (like for example 2 pixels or 3 pixels). Or else use a "smoother" scaling algorithm (e.g. bicubic).
The text was updated successfully, but these errors were encountered: