mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-06 00:12:21 +00:00
Organize imports. (ios) Fix numeric font size handling.
This commit is contained in:
+1
-1
@@ -1,7 +1,7 @@
|
||||
import React from "react";
|
||||
import { requireNativeComponent } from "react-native";
|
||||
import Shape from "./Shape";
|
||||
import extractProps from "../lib/extract/extractProps";
|
||||
import Shape from "./Shape";
|
||||
|
||||
export default class extends Shape {
|
||||
static displayName = "Circle";
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
import React from "react";
|
||||
import { requireNativeComponent } from "react-native";
|
||||
import Shape from "./Shape";
|
||||
import extractProps from "../lib/extract/extractProps";
|
||||
import Shape from "./Shape";
|
||||
|
||||
export default class extends Shape {
|
||||
static displayName = "Ellipse";
|
||||
|
||||
+1
-1
@@ -1,9 +1,9 @@
|
||||
import React from "react";
|
||||
import { requireNativeComponent } from "react-native";
|
||||
import Shape from "./Shape";
|
||||
import extractProps from "../lib/extract/extractProps";
|
||||
import { extractFont } from "../lib/extract/extractText";
|
||||
import extractTransform from "../lib/extract/extractTransform";
|
||||
import Shape from "./Shape";
|
||||
|
||||
export default class extends Shape {
|
||||
static displayName = "G";
|
||||
|
||||
+1
-1
@@ -1,8 +1,8 @@
|
||||
import React from "react";
|
||||
import { Image, requireNativeComponent } from "react-native";
|
||||
import Shape from "./Shape";
|
||||
import { meetOrSliceTypes, alignEnum } from "../lib/extract/extractViewBox";
|
||||
import extractProps from "../lib/extract/extractProps";
|
||||
import Shape from "./Shape";
|
||||
|
||||
const spacesRegExp = /\s+/;
|
||||
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
import React from "react";
|
||||
import { requireNativeComponent } from "react-native";
|
||||
import Shape from "./Shape";
|
||||
import extractProps from "../lib/extract/extractProps";
|
||||
import Shape from "./Shape";
|
||||
|
||||
export default class extends Shape {
|
||||
static displayName = "Line";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React, { Component } from "react";
|
||||
import extractGradient from "../lib/extract/extractGradient";
|
||||
import { requireNativeComponent } from "react-native";
|
||||
import extractGradient from "../lib/extract/extractGradient";
|
||||
|
||||
export default class extends Component {
|
||||
static displayName = "LinearGradient";
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
import React, { Component } from "react";
|
||||
import { requireNativeComponent } from "react-native";
|
||||
import units from "../lib/units";
|
||||
import extractTransform from "../lib/extract/extractTransform";
|
||||
import units from "../lib/units";
|
||||
|
||||
export default class extends Component {
|
||||
static displayName = "Mask";
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
import React from "react";
|
||||
import { requireNativeComponent } from "react-native";
|
||||
import Shape from "./Shape";
|
||||
import extractProps from "../lib/extract/extractProps";
|
||||
import Shape from "./Shape";
|
||||
|
||||
export default class extends Shape {
|
||||
static displayName = "Path";
|
||||
|
||||
+1
-1
@@ -1,8 +1,8 @@
|
||||
import React, { Component } from "react";
|
||||
import { requireNativeComponent } from "react-native";
|
||||
import units from "../lib/units";
|
||||
import extractTransform from "../lib/extract/extractTransform";
|
||||
import extractViewBox from "../lib/extract/extractViewBox";
|
||||
import units from "../lib/units";
|
||||
|
||||
export default class extends Component {
|
||||
static displayName = "Pattern";
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
import React from "react";
|
||||
import Path from "./Path";
|
||||
import extractPolyPoints from "../lib/extract/extractPolyPoints";
|
||||
import Shape from "./Shape";
|
||||
import extractPolyPoints from "../lib/extract/extractPolyPoints";
|
||||
|
||||
export default class extends Shape {
|
||||
static displayName = "Polygon";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React from "react";
|
||||
import Path from "./Path";
|
||||
import extractPolyPoints from "../lib/extract/extractPolyPoints";
|
||||
import Shape from "./Shape";
|
||||
import extractPolyPoints from "../lib/extract/extractPolyPoints";
|
||||
|
||||
export default class extends Shape {
|
||||
static displayName = "Polyline";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React, { Component } from "react";
|
||||
import extractGradient from "../lib/extract/extractGradient";
|
||||
import { requireNativeComponent } from "react-native";
|
||||
import extractGradient from "../lib/extract/extractGradient";
|
||||
|
||||
export default class extends Component {
|
||||
static displayName = "RadialGradient";
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import React from "react";
|
||||
import "./Path"; // must import Path first, don`t know why. without this will throw an `Super expression must either be null or a function, not undefined`
|
||||
import { requireNativeComponent } from "react-native";
|
||||
import extractProps from "../lib/extract/extractProps";
|
||||
import Shape from "./Shape";
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
import React, { Component } from "react";
|
||||
import extractViewBox from "../lib/extract/extractViewBox";
|
||||
import { requireNativeComponent } from "react-native";
|
||||
import extractViewBox from "../lib/extract/extractViewBox";
|
||||
|
||||
export default class extends Component {
|
||||
static displayName = "Symbol";
|
||||
|
||||
+2
-2
@@ -1,10 +1,10 @@
|
||||
import React from "react";
|
||||
import { requireNativeComponent } from "react-native";
|
||||
import extractText, { setTSpan } from "../lib/extract/extractText";
|
||||
import extractProps from "../lib/extract/extractProps";
|
||||
import extractTransform from "../lib/extract/extractTransform";
|
||||
import Shape from "./Shape";
|
||||
import extractText, { setTSpan } from "../lib/extract/extractText";
|
||||
import { pickNotNil } from "../lib/util";
|
||||
import Shape from "./Shape";
|
||||
|
||||
export default class TSpan extends Shape {
|
||||
static displayName = "TSpan";
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import React from "react";
|
||||
|
||||
import { requireNativeComponent } from "react-native";
|
||||
import extractText from "../lib/extract/extractText";
|
||||
import extractProps from "../lib/extract/extractProps";
|
||||
|
||||
@@ -56,10 +56,15 @@ RNSVGFontData *RNSVGFontData_Defaults;
|
||||
RNSVGFontData *data = [RNSVGFontData alloc];
|
||||
CGFloat parentFontSize = parent->fontSize;
|
||||
if ([font objectForKey:FONT_SIZE]) {
|
||||
NSString *string = [font objectForKey:FONT_SIZE];
|
||||
data->fontSize = [RNSVGPropHelper fromRelativeWithNSString:string
|
||||
id fontSize = [font objectForKey:FONT_SIZE];
|
||||
if ([fontSize isKindOfClass:NSNumber.class]) {
|
||||
NSNumber* fs = fontSize;
|
||||
data->fontSize = (CGFloat)[fs doubleValue];
|
||||
} else {
|
||||
data->fontSize = [RNSVGPropHelper fromRelativeWithNSString:fontSize
|
||||
relative:parentFontSize
|
||||
fontSize:parentFontSize];
|
||||
}
|
||||
}
|
||||
else {
|
||||
data->fontSize = parentFontSize;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
const meetOrSliceTypes = {
|
||||
export const meetOrSliceTypes = {
|
||||
meet: 0,
|
||||
slice: 1,
|
||||
none: 2,
|
||||
};
|
||||
|
||||
const alignEnum = [
|
||||
export const alignEnum = [
|
||||
"xMinYMin",
|
||||
"xMidYMin",
|
||||
"xMaxYMin",
|
||||
@@ -56,5 +56,3 @@ export default function(props) {
|
||||
meetOrSlice,
|
||||
};
|
||||
}
|
||||
|
||||
export { meetOrSliceTypes, alignEnum };
|
||||
|
||||
Reference in New Issue
Block a user