Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
J
jadx
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open-source
jadx
Commits
58993b97
Commit
58993b97
authored
Oct 28, 2018
by
Skylot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(gui): apply render hints for line numbers
parent
a3464d71
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
1 deletion
+16
-1
JadxSettingsWindow.java
...i/src/main/java/jadx/gui/settings/JadxSettingsWindow.java
+1
-1
LineNumbers.java
jadx-gui/src/main/java/jadx/gui/ui/codearea/LineNumbers.java
+15
-0
No files found.
jadx-gui/src/main/java/jadx/gui/settings/JadxSettingsWindow.java
View file @
58993b97
...
...
@@ -182,7 +182,7 @@ public class JadxSettingsWindow extends JDialog {
int
result
=
fontChooser
.
showDialog
(
JadxSettingsWindow
.
this
);
if
(
result
==
JFontChooser
.
OK_OPTION
)
{
Font
font
=
fontChooser
.
getSelectedFont
();
LOG
.
info
(
"Selected Font
: {}"
,
font
);
LOG
.
debug
(
"Selected Font
: {}"
,
font
);
settings
.
setFont
(
font
);
mainWindow
.
updateFont
(
font
);
mainWindow
.
loadSettings
();
...
...
jadx-gui/src/main/java/jadx/gui/ui/codearea/LineNumbers.java
View file @
58993b97
...
...
@@ -25,6 +25,7 @@ public class LineNumbers extends JPanel implements CaretListener {
private
static
final
long
serialVersionUID
=
-
4978268673635308190L
;
private
static
final
int
NUM_HEIGHT
=
Integer
.
MAX_VALUE
-
1000000
;
private
static
final
Map
<?,
?>
DESKTOP_HINTS
=
(
Map
<?,
?>)
Toolkit
.
getDefaultToolkit
().
getDesktopProperty
(
"awt.font.desktophints"
);
private
CodeArea
codeArea
;
private
boolean
useSourceLines
=
true
;
...
...
@@ -92,6 +93,7 @@ public class LineNumbers extends JPanel implements CaretListener {
public
void
paintComponent
(
Graphics
g
)
{
super
.
paintComponent
(
g
);
g
.
setFont
(
codeArea
.
getFont
());
applyRenderHints
(
g
);
FontMetrics
fontMetrics
=
codeArea
.
getFontMetrics
(
codeArea
.
getFont
());
Insets
insets
=
getInsets
();
...
...
@@ -119,6 +121,19 @@ public class LineNumbers extends JPanel implements CaretListener {
}
}
private
void
applyRenderHints
(
Graphics
g
)
{
if
(
g
instanceof
Graphics2D
)
{
Graphics2D
g2d
=
(
Graphics2D
)
g
;
if
(
DESKTOP_HINTS
!=
null
)
{
g2d
.
setRenderingHints
(
DESKTOP_HINTS
);
}
else
{
g2d
.
setRenderingHint
(
RenderingHints
.
KEY_RENDERING
,
RenderingHints
.
VALUE_RENDER_QUALITY
);
g2d
.
setRenderingHint
(
RenderingHints
.
KEY_TEXT_ANTIALIASING
,
RenderingHints
.
VALUE_TEXT_ANTIALIAS_ON
);
g2d
.
setRenderingHint
(
RenderingHints
.
KEY_FRACTIONALMETRICS
,
RenderingHints
.
VALUE_FRACTIONALMETRICS_ON
);
}
}
}
private
boolean
isCurrentLine
(
int
rowStartOffset
)
{
int
caretPosition
=
codeArea
.
getCaretPosition
();
Element
root
=
codeArea
.
getDocument
().
getDefaultRootElement
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment