mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-05 16:04:38 +00:00
[android] Fix font and font-size inheritance
Fixes remaining issues, em based units behave correctly now.
This commit is contained in:
@@ -334,6 +334,11 @@ class RenderableViewManager extends ViewGroupManager<VirtualView> {
|
||||
GroupViewManager() {
|
||||
super(SVGClass.RNSVGGroup);
|
||||
}
|
||||
|
||||
@ReactProp(name = "font")
|
||||
public void setFont(GroupView node, @Nullable ReadableMap font) {
|
||||
node.setFont(font);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -463,6 +468,11 @@ class RenderableViewManager extends ViewGroupManager<VirtualView> {
|
||||
public void setY(TextView node, Dynamic positionY) {
|
||||
node.setPositionY(positionY);
|
||||
}
|
||||
|
||||
@ReactProp(name = "font")
|
||||
public void setFont(TextView node, @Nullable ReadableMap font) {
|
||||
node.setFont(font);
|
||||
}
|
||||
}
|
||||
|
||||
static class TextPathViewManager extends RenderableViewManager {
|
||||
@@ -499,6 +509,11 @@ class RenderableViewManager extends ViewGroupManager<VirtualView> {
|
||||
public void setSharp(TextPathView node, @Nullable String midLine) {
|
||||
node.setSharp(midLine);
|
||||
}
|
||||
|
||||
@ReactProp(name = "font")
|
||||
public void setFont(TextView node, @Nullable ReadableMap font) {
|
||||
node.setFont(font);
|
||||
}
|
||||
}
|
||||
|
||||
static class ImageViewManager extends RenderableViewManager {
|
||||
|
||||
@@ -128,12 +128,6 @@ class TextView extends GroupView {
|
||||
invalidate();
|
||||
}
|
||||
|
||||
@ReactProp(name = "font")
|
||||
public void setFont(@Nullable ReadableMap font) {
|
||||
mFont = font;
|
||||
invalidate();
|
||||
}
|
||||
|
||||
@Override
|
||||
void draw(Canvas canvas, Paint paint, float opacity) {
|
||||
if (opacity > MIN_OPACITY_FOR_DRAW) {
|
||||
|
||||
Reference in New Issue
Block a user