refactor(renderer): clean up whitespace and improve variable usage in CustomMultiLineTextArea
This commit is contained in:
@@ -563,7 +563,6 @@ public class CustomMultiLineTextArea extends Component {
|
||||
|
||||
final int clickedWrappedLine = Math.max(0, Math.min(wrappedLines.size() - 1, (logicalMouseY + this.scrollOffsetY) / lineHeight));
|
||||
|
||||
int rawLineIndex = 0;
|
||||
int wrappedLineCount = 0;
|
||||
int charOffset = 0;
|
||||
|
||||
@@ -602,7 +601,6 @@ public class CustomMultiLineTextArea extends Component {
|
||||
}
|
||||
|
||||
if (clickedWrappedLine >= wrappedLineCount && clickedWrappedLine < wrappedLineCount + linesForThisRaw) {
|
||||
rawLineIndex = i;
|
||||
final String clickedLine = wrappedLines.get(clickedWrappedLine);
|
||||
|
||||
int bestPos = 0;
|
||||
@@ -653,7 +651,6 @@ public class CustomMultiLineTextArea extends Component {
|
||||
final int posInRaw = this.caretPosition - charCount;
|
||||
|
||||
int currentPos = 0;
|
||||
int wrappedOffset = 0;
|
||||
|
||||
while (wrappedLineIndex < wrappedLines.size()) {
|
||||
final String wrappedLine = wrappedLines.get(wrappedLineIndex);
|
||||
@@ -665,7 +662,6 @@ public class CustomMultiLineTextArea extends Component {
|
||||
|
||||
currentPos += wrappedLen + 1;
|
||||
wrappedLineIndex++;
|
||||
wrappedOffset++;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -953,12 +949,12 @@ public class CustomMultiLineTextArea extends Component {
|
||||
g2d.fillRect(selX, (int) (yPos * this.scaleFactor), selDim.getX(), (int) (lineHeight * this.scaleFactor));
|
||||
|
||||
g2d.setColor(theme.getBackgroundNormal().toColor());
|
||||
G2DDrawFont.renderText(g2d, null, this.scaleFactor, (int)(selX / this.scaleFactor), yPos, this.fontSize, selected);
|
||||
G2DDrawFont.renderText(g2d, null, this.scaleFactor, (int) (selX / this.scaleFactor), yPos, this.fontSize, selected);
|
||||
|
||||
if (lineSelEnd < line.length()) {
|
||||
final String afterSel = line.substring(lineSelEnd);
|
||||
g2d.setColor(fgColor);
|
||||
G2DDrawFont.renderText(g2d, null, this.scaleFactor, (int)((selX + selDim.getX()) / this.scaleFactor), yPos, this.fontSize, afterSel);
|
||||
G2DDrawFont.renderText(g2d, null, this.scaleFactor, (int) ((selX + selDim.getX()) / this.scaleFactor), yPos, this.fontSize, afterSel);
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user