Implement rotate and textDecoration

This commit is contained in:
Mikael Sand
2017-07-16 01:50:59 +03:00
parent 61a17cb120
commit 2458a2f262
6 changed files with 131 additions and 9 deletions

View File

@@ -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(),