style(amis-editor):优化移动端尺寸控制器样式 (#11007)

* style(amis-editor):优化移动端尺寸控制器样式

* bugfix

---------

Co-authored-by: qinhaoyan <30946345+qinhaoyan@users.noreply.github.com>
This commit is contained in:
qkiroc 2024-10-10 20:55:06 +08:00 committed by GitHub
parent 9f136b0f5f
commit 4aad5fb818
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 6 deletions

View File

@ -1967,8 +1967,9 @@ div[class*='Form-group']:empty {
position: relative;
.ae-Preview {
position: absolute;
transform: translate(-50%, -50%);
top: 53%;
transform: translateX(-50%);
transform-origin: top;
top: 10%;
left: 50%;
width: 395px;
height: 687px;

View File

@ -150,7 +150,7 @@ export default function MobileDevTool(props: {
initialSize.current;
const scale = Math.min(
(width - 50) / previewBodyWidth,
(height - 50) / previewBodyHeight
(height * 0.9) / previewBodyHeight
);
setAutoScale(Math.floor(scale * 100));
}
@ -228,7 +228,7 @@ export default function MobileDevTool(props: {
function updatePreviewScale(scale: number) {
if (previewBody) {
previewBody.style.transform =
'translate(-50%, -50%) scale(' + scale / 100 + ')';
'translateX(-50%) scale(' + scale / 100 + ')';
}
}
@ -347,7 +347,7 @@ function CustomSizeHandle(props: {
if (previewBody) {
let w = previewBody.clientWidth;
w += e.movementX;
w = Math.max(20, w);
w = Math.max(70, w);
previewBody.style.width = w + 'px';
onChange?.(w, previewBody.clientHeight);
}
@ -372,7 +372,7 @@ function CustomSizeHandle(props: {
if (previewBody) {
let h = previewBody.clientHeight;
h += e.movementY;
h = Math.max(20, h);
h = Math.max(70, h);
previewBody.style.height = h + 'px';
onChange?.(previewBody.clientWidth, h);
}