Skip to content

Commit d26ea52

Browse files
committed
Add even more Antialiasing
1 parent 566527e commit d26ea52

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

  • src/main/java/the/bytecode/club/bytecodeviewer/gui/hexviewer

src/main/java/the/bytecode/club/bytecodeviewer/gui/hexviewer/JHexEditor.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package the.bytecode.club.bytecodeviewer.gui.hexviewer;
22

3+
import java.awt.Graphics2D;
4+
import java.awt.RenderingHints;
35
import the.bytecode.club.bytecodeviewer.BytecodeViewer;
46

57
import java.awt.BorderLayout;
@@ -160,8 +162,11 @@ protected void border(Graphics g, int x, int y, int s) {
160162
fn.getHeight() + 1);
161163
}
162164

163-
protected void printString(Graphics g, String s, int x, int y) {
165+
protected void printString(Graphics graphics, String s, int x, int y) {
166+
Graphics2D g = (Graphics2D) graphics;
164167
FontMetrics fn = getFontMetrics(font);
168+
g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
169+
RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
165170
g.drawString(s, ((fn.stringWidth(" ") + 1) * x) + border,
166171
((fn.getHeight() * (y + 1)) - fn.getMaxDescent()) + border);
167172
}

0 commit comments

Comments
 (0)