mirror of
				https://github.com/excalidraw/excalidraw.git
				synced 2025-11-04 04:44:31 +01:00 
			
		
		
		
	fix: fixed detecting viewport outside of constraints
This commit is contained in:
		@@ -328,18 +328,14 @@ const isViewportOutsideOfConstrainedArea = (state: AppState) => {
 | 
			
		||||
  const scrollConstraints = alignScrollConstraints(inverseScrollConstraints);
 | 
			
		||||
 | 
			
		||||
  // Adjust scroll and dimensions according to the zoom level
 | 
			
		||||
  const adjustedScrollX = scrollX * zoom.value;
 | 
			
		||||
  const adjustedScrollY = scrollY * zoom.value;
 | 
			
		||||
  const adjustedWidth = width / zoom.value;
 | 
			
		||||
  const adjustedHeight = height / zoom.value;
 | 
			
		||||
 | 
			
		||||
  return (
 | 
			
		||||
    adjustedScrollX > scrollConstraints.x ||
 | 
			
		||||
    adjustedScrollX - adjustedWidth <
 | 
			
		||||
      scrollConstraints.x - scrollConstraints.width ||
 | 
			
		||||
    adjustedScrollY > scrollConstraints.y ||
 | 
			
		||||
    adjustedScrollY - adjustedHeight <
 | 
			
		||||
      scrollConstraints.y - scrollConstraints.height
 | 
			
		||||
    scrollX > scrollConstraints.x ||
 | 
			
		||||
    scrollX - adjustedWidth < scrollConstraints.x - scrollConstraints.width ||
 | 
			
		||||
    scrollY > scrollConstraints.y ||
 | 
			
		||||
    scrollY - adjustedHeight < scrollConstraints.y - scrollConstraints.height
 | 
			
		||||
  );
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user