fix: Text color doesn't work with inlineSize #1225

This commit is contained in:
Mikael Sand
2020-01-01 20:28:30 +02:00
parent 690c3aa4e0
commit 027b8c16aa
5 changed files with 44 additions and 5 deletions
@@ -421,7 +421,7 @@ abstract public class RenderableView extends VirtualView {
* Sets up paint according to the props set on a view. Returns {@code true}
* if the fill should be drawn, {@code false} if not.
*/
private boolean setupFillPaint(Paint paint, float opacity) {
boolean setupFillPaint(Paint paint, float opacity) {
if (fill != null && fill.size() > 0) {
paint.reset();
paint.setFlags(Paint.ANTI_ALIAS_FLAG | Paint.DEV_KERN_TEXT_FLAG | Paint.SUBPIXEL_TEXT_FLAG);
@@ -436,7 +436,7 @@ abstract public class RenderableView extends VirtualView {
* Sets up paint according to the props set on a view. Returns {@code true}
* if the stroke should be drawn, {@code false} if not.
*/
private boolean setupStrokePaint(Paint paint, float opacity) {
boolean setupStrokePaint(Paint paint, float opacity) {
paint.reset();
double strokeWidth = relativeOnOther(this.strokeWidth);
if (strokeWidth == 0 || stroke == null || stroke.size() == 0) {
@@ -93,7 +93,12 @@ class TSpanView extends TextView {
void draw(Canvas canvas, Paint paint, float opacity) {
if (mContent != null) {
if (mInlineSize != null && mInlineSize.value != 0) {
drawWrappedText(canvas, paint);
if (setupFillPaint(paint, opacity * fillOpacity)) {
drawWrappedText(canvas, paint);
}
if (setupStrokePaint(paint, opacity * strokeOpacity)) {
drawWrappedText(canvas, paint);
}
} else {
int numEmoji = emoji.size();
if (numEmoji > 0) {