mirror of
https://github.com/niklasvh/html2canvas.git
synced 2023-08-10 21:13:10 +03:00
Handle undefined values for textShadow/transform (IE9)
This commit is contained in:
parent
10ec079762
commit
6baa847092
@ -13,8 +13,8 @@ export type TextShadow = {
|
||||
const TEXT_SHADOW_PROPERTY = /((rgba|rgb)\([^\)]+\)(\s-?\d+px){3})/g;
|
||||
const TEXT_SHADOW_VALUES = /(-?\d+px)|(#.+)|(rgb\(.+\))|(rgba\(.+\))/g;
|
||||
|
||||
export const parseTextShadow = (textShadow: string): Array<TextShadow> | null => {
|
||||
if (textShadow === 'none') {
|
||||
export const parseTextShadow = (textShadow: ?string): Array<TextShadow> | null => {
|
||||
if (textShadow === 'none' || typeof(textShadow) !== 'string') {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -31,10 +31,11 @@ const parseTransformOrigin = (origin: string): TransformOrigin => {
|
||||
return [values[0], values[1]];
|
||||
};
|
||||
|
||||
const parseTransformMatrix = (transform: string): Matrix | null => {
|
||||
if (transform === 'none') {
|
||||
const parseTransformMatrix = (transform: ?string): Matrix | null => {
|
||||
if (transform === 'none' || typeof(transform) !== 'string') {
|
||||
return null;
|
||||
}
|
||||
|
||||
const match = transform.match(MATRIX);
|
||||
if (match) {
|
||||
if (match[1] === 'matrix') {
|
||||
|
Loading…
Reference in New Issue
Block a user