mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-01 22:25:12 +00:00
fix: Text color doesn't work with inlineSize #1225
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user