File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
src/main/java/com/cleanroommc/modularui/widgets/textfield Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change 33import org .jetbrains .annotations .ApiStatus ;
44import org .jetbrains .annotations .NotNull ;
55
6+ import java .awt .*;
67import java .text .DecimalFormat ;
78import java .util .List ;
89import java .util .stream .Collectors ;
@@ -23,8 +24,17 @@ public IntegerFieldRenderer(TextFieldHandler handler) {
2324
2425 @ Override
2526 public void draw (List <String > lines ) {
26- super .draw (lines .stream ().map (IntegerFieldRenderer ::tryFormatString )
27- .collect (Collectors .toList ()));
27+ super .draw (decorateLines (lines ));
28+ }
29+
30+ private static @ NotNull List <String > decorateLines (List <String > lines ) {
31+ return lines .stream ().map (IntegerFieldRenderer ::tryFormatString )
32+ .collect (Collectors .toList ());
33+ }
34+
35+ @ Override
36+ public Point getCursorPos (List <String > lines , int x , int y ) {
37+ return super .getCursorPos (decorateLines (lines ), x , y );
2838 }
2939
3040 private static @ NotNull String tryFormatString (String str ) {
You can’t perform that action at this time.
0 commit comments