add x,y parameters to rotate MFM

This commit is contained in:
Johann150 2022-04-26 22:26:22 +02:00
parent b9e3267198
commit 92d53f7441
No known key found for this signature in database
GPG key ID: 9EE6577A2A06F8F1

View file

@ -178,8 +178,12 @@ export default defineComponent({
return h(MkSparkle, {}, genEl(token.children)); return h(MkSparkle, {}, genEl(token.children));
} }
case 'rotate': { case 'rotate': {
const rotateDir =
token.props.args.x ? 'X' :
token.props.args.y ? 'Y' :
'';
const degrees = parseInt(token.props.args.deg) || '90'; const degrees = parseInt(token.props.args.deg) || '90';
style = `transform: rotate(${degrees}deg); transform-origin: center center;`; style = `transform: rotate${rotateDir}(${degrees}deg); transform-origin: center center;`;
break; break;
} }
} }