Remove background highlighting from empty lines in image editor.

Co-Authored-By: GitStart <1501599+gitstart@users.noreply.github.com>

Fixes #12612
main
Alex Hart 2022-11-17 12:33:29 -04:00 zatwierdzone przez Cody Henthorne
rodzic dfb913cb98
commit 2200af9c31
1 zmienionych plików z 8 dodań i 4 usunięć

Wyświetl plik

@ -320,10 +320,14 @@ public final class MultiLineTextRenderer extends InvalidateableRenderer implemen
rendererContext.canvasMatrix.concat(projectionMatrix);
if (mode == Mode.HIGHLIGHT) {
modeBounds.set(textBounds.left - HIGHLIGHT_HORIZONTAL_PADDING,
selectionBounds.top - HIGHLIGHT_TOP_PADDING,
textBounds.right + HIGHLIGHT_HORIZONTAL_PADDING,
selectionBounds.bottom + HIGHLIGHT_BOTTOM_PADDING);
if(text.isEmpty()){
modeBounds.setEmpty();
}else{
modeBounds.set(textBounds.left - HIGHLIGHT_HORIZONTAL_PADDING,
selectionBounds.top - HIGHLIGHT_TOP_PADDING,
textBounds.right + HIGHLIGHT_HORIZONTAL_PADDING,
selectionBounds.bottom + HIGHLIGHT_BOTTOM_PADDING);
}
int alpha = modePaint.getAlpha();
modePaint.setAlpha(rendererContext.getAlpha(alpha));
rendererContext.canvas.drawRoundRect(modeBounds, HIGHLIGHT_CORNER_RADIUS, HIGHLIGHT_CORNER_RADIUS, modePaint);