mirror of
https://github.com/zoriya/react-native-svg.git
synced 2025-12-20 22:05:14 +00:00
Implement rotate and textDecoration
This commit is contained in:
@@ -15,6 +15,13 @@ const anchors = {
|
||||
end: 3
|
||||
};
|
||||
|
||||
const decorations = {
|
||||
none: 0,
|
||||
underline: 1,
|
||||
overline: 2,
|
||||
'line-through': 3,
|
||||
blink: 4
|
||||
};
|
||||
let cachedFontObjectsFromString = {};
|
||||
|
||||
function extractSingleFontFamily(fontFamilyString) {
|
||||
@@ -91,15 +98,18 @@ export default function(props, container) {
|
||||
y,
|
||||
dx,
|
||||
dy,
|
||||
rotate,
|
||||
method,
|
||||
spacing,
|
||||
textAnchor,
|
||||
startOffset
|
||||
startOffset,
|
||||
textDecoration
|
||||
} = props;
|
||||
|
||||
|
||||
const deltaX = parseDelta(dx);
|
||||
const deltaY = parseDelta(dy);
|
||||
const rotates = parseDelta(rotate);
|
||||
let { children } = props;
|
||||
let content = null;
|
||||
|
||||
@@ -123,12 +133,14 @@ export default function(props, container) {
|
||||
}
|
||||
|
||||
return {
|
||||
textDecoration: decorations[textDecoration] || 0,
|
||||
textAnchor: anchors[textAnchor] || 0,
|
||||
font: extractFont(props),
|
||||
children,
|
||||
content,
|
||||
deltaX,
|
||||
deltaY,
|
||||
rotate: rotates,
|
||||
method,
|
||||
spacing,
|
||||
startOffset: (startOffset || 0).toString(),
|
||||
|
||||
Reference in New Issue
Block a user