diff options
Diffstat (limited to 'src/main/java/cuchaz/enigma/gui/highlight')
| -rw-r--r-- | src/main/java/cuchaz/enigma/gui/highlight/BoxHighlightPainter.java | 4 | ||||
| -rw-r--r-- | src/main/java/cuchaz/enigma/gui/highlight/TokenHighlightType.java | 7 |
2 files changed, 10 insertions, 1 deletions
diff --git a/src/main/java/cuchaz/enigma/gui/highlight/BoxHighlightPainter.java b/src/main/java/cuchaz/enigma/gui/highlight/BoxHighlightPainter.java index 10366ce..cef6494 100644 --- a/src/main/java/cuchaz/enigma/gui/highlight/BoxHighlightPainter.java +++ b/src/main/java/cuchaz/enigma/gui/highlight/BoxHighlightPainter.java | |||
| @@ -34,7 +34,9 @@ public class BoxHighlightPainter implements Highlighter.HighlightPainter { | |||
| 34 | public static Rectangle getBounds(JTextComponent text, int start, int end) { | 34 | public static Rectangle getBounds(JTextComponent text, int start, int end) { |
| 35 | try { | 35 | try { |
| 36 | // determine the bounds of the text | 36 | // determine the bounds of the text |
| 37 | Rectangle bounds = text.modelToView(start).union(text.modelToView(end)); | 37 | Rectangle startRect = text.modelToView(start); |
| 38 | Rectangle endRect = text.modelToView(end); | ||
| 39 | Rectangle bounds = startRect.union(endRect); | ||
| 38 | 40 | ||
| 39 | // adjust the box so it looks nice | 41 | // adjust the box so it looks nice |
| 40 | bounds.x -= 2; | 42 | bounds.x -= 2; |
diff --git a/src/main/java/cuchaz/enigma/gui/highlight/TokenHighlightType.java b/src/main/java/cuchaz/enigma/gui/highlight/TokenHighlightType.java new file mode 100644 index 0000000..ae23f32 --- /dev/null +++ b/src/main/java/cuchaz/enigma/gui/highlight/TokenHighlightType.java | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | package cuchaz.enigma.gui.highlight; | ||
| 2 | |||
| 3 | public enum TokenHighlightType { | ||
| 4 | OBFUSCATED, | ||
| 5 | DEOBFUSCATED, | ||
| 6 | PROPOSED | ||
| 7 | } | ||