Update AsyncDrawableSpan.java
Don't extend drawable beyond screen.
This commit is contained in:
parent
2ea148c30a
commit
071d72d649
@ -101,10 +101,8 @@ public class AsyncDrawableSpan extends ReplacementSpan {
|
||||
@NonNull Paint paint) {
|
||||
|
||||
// @since 4.4.0 use SpanUtils instead of `canvas.getWidth`
|
||||
drawable.initWithKnownDimensions(
|
||||
SpanUtils.width(canvas, text),
|
||||
paint.getTextSize()
|
||||
);
|
||||
final int width = (int) (SpanUtils.width(canvas, text) - x);
|
||||
getDrawable().initWithKnownDimensions(width, paint.getTextSize());
|
||||
|
||||
final AsyncDrawable drawable = this.drawable;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user