mirror of
https://github.com/nexu-io/open-design.git
synced 2026-06-01 03:14:35 +07:00
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:
parent
a4ec7808a6
commit
5db6cab5f6
1 changed files with 4 additions and 4 deletions
|
|
@ -516,8 +516,8 @@ function previewScaleShellStyle(
|
|||
): CSSProperties & Record<string, string | number> {
|
||||
if (viewport === 'desktop') {
|
||||
return {
|
||||
width: `${100 / previewScale}%`,
|
||||
height: `${100 / previewScale}%`,
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
transform: `scale(${previewScale})`,
|
||||
transformOrigin: '0 0',
|
||||
};
|
||||
|
|
@ -537,8 +537,8 @@ function manualEditPreviewShellStyle(
|
|||
): CSSProperties & Record<string, string | number> {
|
||||
if (viewport === 'desktop' && frozenWidth) {
|
||||
return {
|
||||
width: `${frozenWidth / previewScale}px`,
|
||||
height: `${100 / previewScale}%`,
|
||||
width: `${frozenWidth}px`,
|
||||
height: '100%',
|
||||
transform: `scale(${previewScale})`,
|
||||
transformOrigin: '0 0',
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue