mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-06-19 04:01:33 +08:00
parent
41a8400095
commit
b1bd7a870e
@ -29,7 +29,7 @@ import {
|
|||||||
triggerCommonMethod,
|
triggerCommonMethod,
|
||||||
} from './events';
|
} from './events';
|
||||||
import Page from './Page';
|
import Page from './Page';
|
||||||
import { fillBackgroundImage, style2Obj } from './utils';
|
import { fillBackgroundImage, isNumber, style2Obj } from './utils';
|
||||||
|
|
||||||
interface AppOptionsConfig {
|
interface AppOptionsConfig {
|
||||||
ua?: string;
|
ua?: string;
|
||||||
@ -125,6 +125,9 @@ class App extends EventEmitter {
|
|||||||
if (transformKey === 'scale') {
|
if (transformKey === 'scale') {
|
||||||
defaultValue = 1;
|
defaultValue = 1;
|
||||||
}
|
}
|
||||||
|
if (transformKey === 'rotate' && isNumber(transformValue)) {
|
||||||
|
transformValue = `${transformValue}deg`;
|
||||||
|
}
|
||||||
return `${transformKey}(${transformValue || defaultValue})`;
|
return `${transformKey}(${transformValue || defaultValue})`;
|
||||||
})
|
})
|
||||||
.join(' ');
|
.join(' ');
|
||||||
|
@ -53,3 +53,5 @@ export const fillBackgroundImage = (value: string) => {
|
|||||||
}
|
}
|
||||||
return value;
|
return value;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const isNumber = (value: string) => /^(-?\d+)(\.\d+)?$/.test(value);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user