mirror of
https://activitypub.software/TransFem-org/Sharkey
synced 2024-11-29 09:23:04 +00:00
fix(client): MFMのposition、rotate、scaleで小数が使えない問題を修正
This commit is contained in:
parent
3ba5541a66
commit
e3275e916b
1 changed files with 5 additions and 5 deletions
|
@ -190,19 +190,19 @@ export default defineComponent({
|
||||||
return h(MkSparkle, {}, genEl(token.children));
|
return h(MkSparkle, {}, genEl(token.children));
|
||||||
}
|
}
|
||||||
case 'rotate': {
|
case 'rotate': {
|
||||||
const degrees = parseInt(token.props.args.deg) ?? '90';
|
const degrees = parseFloat(token.props.args.deg) ?? '90';
|
||||||
style = `transform: rotate(${degrees}deg); transform-origin: center center;`;
|
style = `transform: rotate(${degrees}deg); transform-origin: center center;`;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'position': {
|
case 'position': {
|
||||||
const x = parseInt(token.props.args.x ?? '0');
|
const x = parseFloat(token.props.args.x ?? '0');
|
||||||
const y = parseInt(token.props.args.y ?? '0');
|
const y = parseFloat(token.props.args.y ?? '0');
|
||||||
style = `transform: translateX(${x}em) translateY(${y}em);`;
|
style = `transform: translateX(${x}em) translateY(${y}em);`;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'scale': {
|
case 'scale': {
|
||||||
const x = Math.min(parseInt(token.props.args.x ?? '1'), 5);
|
const x = Math.min(parseFloat(token.props.args.x ?? '1'), 5);
|
||||||
const y = Math.min(parseInt(token.props.args.y ?? '1'), 5);
|
const y = Math.min(parseFloat(token.props.args.y ?? '1'), 5);
|
||||||
style = `transform: scale(${x}, ${y});`;
|
style = `transform: scale(${x}, ${y});`;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue