From e3275e916b92d05241bff4b1391d6166c4ab1ec1 Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 25 Jan 2023 15:15:15 +0900 Subject: [PATCH] =?UTF-8?q?fix(client):=20MFM=E3=81=AEposition=E3=80=81rot?= =?UTF-8?q?ate=E3=80=81scale=E3=81=A7=E5=B0=8F=E6=95=B0=E3=81=8C=E4=BD=BF?= =?UTF-8?q?=E3=81=88=E3=81=AA=E3=81=84=E5=95=8F=E9=A1=8C=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/frontend/src/components/mfm.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/frontend/src/components/mfm.ts b/packages/frontend/src/components/mfm.ts index 91875de9c..b9ed9002a 100644 --- a/packages/frontend/src/components/mfm.ts +++ b/packages/frontend/src/components/mfm.ts @@ -190,19 +190,19 @@ export default defineComponent({ return h(MkSparkle, {}, genEl(token.children)); } 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;`; break; } case 'position': { - const x = parseInt(token.props.args.x ?? '0'); - const y = parseInt(token.props.args.y ?? '0'); + const x = parseFloat(token.props.args.x ?? '0'); + const y = parseFloat(token.props.args.y ?? '0'); style = `transform: translateX(${x}em) translateY(${y}em);`; break; } case 'scale': { - const x = Math.min(parseInt(token.props.args.x ?? '1'), 5); - const y = Math.min(parseInt(token.props.args.y ?? '1'), 5); + const x = Math.min(parseFloat(token.props.args.x ?? '1'), 5); + const y = Math.min(parseFloat(token.props.args.y ?? '1'), 5); style = `transform: scale(${x}, ${y});`; break; }