mirror of
				https://github.com/excalidraw/excalidraw.git
				synced 2025-10-31 19:04:35 +01:00 
			
		
		
		
	fix: disable caching bounds for arrow labels (#7343)
This commit is contained in:
		 David Luzar
					David Luzar
				
			
				
					committed by
					
						 Aakansha Doshi
						Aakansha Doshi
					
				
			
			
				
	
			
			
			 Aakansha Doshi
						Aakansha Doshi
					
				
			
						parent
						
							8d0a8ce65b
						
					
				
				
					commit
					f53edb7437
				
			| @@ -13,6 +13,7 @@ import { Point } from "../types"; | ||||
| import { generateRoughOptions } from "../scene/Shape"; | ||||
| import { | ||||
|   isArrowElement, | ||||
|   isBoundToContainer, | ||||
|   isFreeDrawElement, | ||||
|   isLinearElement, | ||||
|   isTextElement, | ||||
| @@ -54,7 +55,13 @@ export class ElementBounds { | ||||
|   static getBounds(element: ExcalidrawElement) { | ||||
|     const cachedBounds = ElementBounds.boundsCache.get(element); | ||||
|  | ||||
|     if (cachedBounds?.version && cachedBounds.version === element.version) { | ||||
|     if ( | ||||
|       cachedBounds?.version && | ||||
|       cachedBounds.version === element.version && | ||||
|       // we don't invalidate cache when we update containers and not labels, | ||||
|       // which is causing problems down the line. Fix TBA. | ||||
|       !isBoundToContainer(element) | ||||
|     ) { | ||||
|       return cachedBounds.bounds; | ||||
|     } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user