kopia lustrzana https://github.com/ryukoposting/Signal-Android
rodzic
b437cb0344
commit
5634e9834d
|
@ -320,9 +320,9 @@ public final class MultiLineTextRenderer extends InvalidateableRenderer implemen
|
||||||
rendererContext.canvasMatrix.concat(projectionMatrix);
|
rendererContext.canvasMatrix.concat(projectionMatrix);
|
||||||
|
|
||||||
if (mode == Mode.HIGHLIGHT) {
|
if (mode == Mode.HIGHLIGHT) {
|
||||||
if(text.isEmpty()){
|
if (text.isEmpty()) {
|
||||||
modeBounds.setEmpty();
|
modeBounds.setEmpty();
|
||||||
}else{
|
} else {
|
||||||
modeBounds.set(textBounds.left - HIGHLIGHT_HORIZONTAL_PADDING,
|
modeBounds.set(textBounds.left - HIGHLIGHT_HORIZONTAL_PADDING,
|
||||||
selectionBounds.top - HIGHLIGHT_TOP_PADDING,
|
selectionBounds.top - HIGHLIGHT_TOP_PADDING,
|
||||||
textBounds.right + HIGHLIGHT_HORIZONTAL_PADDING,
|
textBounds.right + HIGHLIGHT_HORIZONTAL_PADDING,
|
||||||
|
@ -333,13 +333,17 @@ public final class MultiLineTextRenderer extends InvalidateableRenderer implemen
|
||||||
rendererContext.canvas.drawRoundRect(modeBounds, HIGHLIGHT_CORNER_RADIUS, HIGHLIGHT_CORNER_RADIUS, modePaint);
|
rendererContext.canvas.drawRoundRect(modeBounds, HIGHLIGHT_CORNER_RADIUS, HIGHLIGHT_CORNER_RADIUS, modePaint);
|
||||||
modePaint.setAlpha(alpha);
|
modePaint.setAlpha(alpha);
|
||||||
} else if (mode == Mode.UNDERLINE) {
|
} else if (mode == Mode.UNDERLINE) {
|
||||||
modeBounds.set(textBounds.left, selectionBounds.top, textBounds.right, selectionBounds.bottom);
|
if (text.isEmpty()) {
|
||||||
modeBounds.inset(-DimensionUnit.DP.toPixels(2), -DimensionUnit.DP.toPixels(2));
|
modeBounds.setEmpty();
|
||||||
|
} else {
|
||||||
|
modeBounds.set(textBounds.left, selectionBounds.top, textBounds.right, selectionBounds.bottom);
|
||||||
|
modeBounds.inset(-DimensionUnit.DP.toPixels(2), -DimensionUnit.DP.toPixels(2));
|
||||||
|
|
||||||
modeBounds.set(modeBounds.left,
|
modeBounds.set(modeBounds.left,
|
||||||
Math.max(modeBounds.top, modeBounds.bottom - DimensionUnit.DP.toPixels(6)),
|
Math.max(modeBounds.top, modeBounds.bottom - DimensionUnit.DP.toPixels(6)),
|
||||||
modeBounds.right,
|
modeBounds.right,
|
||||||
modeBounds.bottom - DimensionUnit.DP.toPixels(2));
|
modeBounds.bottom - DimensionUnit.DP.toPixels(2));
|
||||||
|
}
|
||||||
|
|
||||||
int alpha = modePaint.getAlpha();
|
int alpha = modePaint.getAlpha();
|
||||||
modePaint.setAlpha(rendererContext.getAlpha(alpha));
|
modePaint.setAlpha(rendererContext.getAlpha(alpha));
|
||||||
|
|
Ładowanie…
Reference in New Issue