fix: disable caching bounds for arrow labels (#7343)
This commit is contained in:
parent
14845a343b
commit
fe75f29c15
@ -13,6 +13,7 @@ import { Point } from "../types";
|
|||||||
import { generateRoughOptions } from "../scene/Shape";
|
import { generateRoughOptions } from "../scene/Shape";
|
||||||
import {
|
import {
|
||||||
isArrowElement,
|
isArrowElement,
|
||||||
|
isBoundToContainer,
|
||||||
isFreeDrawElement,
|
isFreeDrawElement,
|
||||||
isLinearElement,
|
isLinearElement,
|
||||||
isTextElement,
|
isTextElement,
|
||||||
@ -54,7 +55,13 @@ export class ElementBounds {
|
|||||||
static getBounds(element: ExcalidrawElement) {
|
static getBounds(element: ExcalidrawElement) {
|
||||||
const cachedBounds = ElementBounds.boundsCache.get(element);
|
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;
|
return cachedBounds.bounds;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user