fix: Image and video resize calculation

This commit is contained in:
Tom Moor
2024-08-10 19:38:00 -04:00
parent fbc4a7fcbd
commit d8145ac370
2 changed files with 9 additions and 10 deletions
+6 -9
View File
@@ -507,12 +507,7 @@ class DocumentScene extends React.Component<Props> {
onSave={this.onSave}
headings={this.headings}
/>
<MeasuredContainer
as={Main}
name="document"
fullWidth={document.fullWidth}
tocPosition={tocPos}
>
<Main fullWidth={document.fullWidth} tocPosition={tocPos}>
<React.Suspense
fallback={
<EditorContainer
@@ -542,7 +537,9 @@ class DocumentScene extends React.Component<Props> {
<Contents headings={this.headings} />
</ContentsContainer>
)}
<EditorContainer
<MeasuredContainer
name="document"
as={EditorContainer}
docFullWidth={document.fullWidth}
showContents={showContents}
tocPosition={tocPos}
@@ -595,11 +592,11 @@ class DocumentScene extends React.Component<Props> {
</>
)}
</Editor>
</EditorContainer>
</MeasuredContainer>
</>
)}
</React.Suspense>
</MeasuredContainer>
</Main>
{isShare &&
!parseDomain(window.location.origin).custom &&
!auth.user && (
@@ -1,4 +1,5 @@
import * as React from "react";
import { EditorStyleHelper } from "../../styles/EditorStyleHelper";
type DragDirection = "left" | "right";
@@ -113,7 +114,8 @@ export default function useDragResize(props: Params): ReturnValue {
getComputedStyle(props.ref.current).getPropertyValue(
"--document-width"
)
)
) -
EditorStyleHelper.padding * 2
: Infinity;
setMaxWidth(max);
setSizeAtDragStart({