Skip to content

Commit

Permalink
fix: unnecessary calc
Browse files Browse the repository at this point in the history
  • Loading branch information
Palanikannan1437 committed Sep 17, 2024
1 parent a8db124 commit fb6cb3e
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,13 @@ export const CustomImageBlock: React.FC<CustomImageNodeViewProps> = (props) => {

const handleResize = useCallback(
(e: MouseEvent | TouchEvent) => {
if (!isResizing.current || !containerRef.current || !containerRect.current) return;

if (size) {
aspectRatioRef.current = Number(size.width.replace("px", "")) / Number(size.height.replace("px", ""));
}

if (!isResizing.current || !containerRef.current || !containerRect.current || !aspectRatioRef.current) return;
if (!aspectRatioRef.current) return;

const clientX = "touches" in e ? e.touches[0].clientX : e.clientX;

Expand Down

0 comments on commit fb6cb3e

Please sign in to comment.