fix: simplify PPT preview zoom to use direct scaling

Replace the inverse-scale technique (width: 100/scale%, transform: scale())
with direct scaling (width: 100%, transform: scale()). The previous approach
caused the container size to shrink as zoom increased, which could affect
pagination controls and other overlay elements that depend on container
dimensions.

The new approach:
- Sets container to 100% width/height
- Applies transform: scale() directly
- Keeps zoom direction intuitive (+ enlarges, - shrinks)
- Prevents pagination controls from scaling with content

Fixes #3177
This commit is contained in:
xxiaoxiong 2026-05-28 21:11:46 +08:00
parent a4ec7808a6
commit 5db6cab5f6

View file

@ -516,8 +516,8 @@ function previewScaleShellStyle(
): CSSProperties & Record<string, string | number> { ): CSSProperties & Record<string, string | number> {
if (viewport === 'desktop') { if (viewport === 'desktop') {
return { return {
width: `${100 / previewScale}%`, width: '100%',
height: `${100 / previewScale}%`, height: '100%',
transform: `scale(${previewScale})`, transform: `scale(${previewScale})`,
transformOrigin: '0 0', transformOrigin: '0 0',
}; };
@ -537,8 +537,8 @@ function manualEditPreviewShellStyle(
): CSSProperties & Record<string, string | number> { ): CSSProperties & Record<string, string | number> {
if (viewport === 'desktop' && frozenWidth) { if (viewport === 'desktop' && frozenWidth) {
return { return {
width: `${frozenWidth / previewScale}px`, width: `${frozenWidth}px`,
height: `${100 / previewScale}%`, height: '100%',
transform: `scale(${previewScale})`, transform: `scale(${previewScale})`,
transformOrigin: '0 0', transformOrigin: '0 0',
}; };