fix: pending review fixes for sticky notes (#4493)
This commit is contained in:
@ -46,8 +46,7 @@ const isElementDraggableFromInside = (
|
||||
return true;
|
||||
}
|
||||
const isDraggableFromInside =
|
||||
!isTransparent(element.backgroundColor) ||
|
||||
(isTransparent(element.backgroundColor) && hasBoundTextElement(element));
|
||||
!isTransparent(element.backgroundColor) || hasBoundTextElement(element);
|
||||
if (element.type === "line") {
|
||||
return isDraggableFromInside && isPathALoop(element.points);
|
||||
}
|
||||
|
@ -322,25 +322,11 @@ export const charWidth = (() => {
|
||||
return cachedCharWidth[font][ascii];
|
||||
};
|
||||
|
||||
const updateCache = (char: string, font: FontString) => {
|
||||
const ascii = char.charCodeAt(0);
|
||||
|
||||
if (!cachedCharWidth[font][ascii]) {
|
||||
cachedCharWidth[font][ascii] = calculate(char, font);
|
||||
}
|
||||
};
|
||||
|
||||
const clearCacheforFont = (font: FontString) => {
|
||||
cachedCharWidth[font] = [];
|
||||
};
|
||||
|
||||
const getCache = (font: FontString) => {
|
||||
return cachedCharWidth[font];
|
||||
};
|
||||
return {
|
||||
calculate,
|
||||
updateCache,
|
||||
clearCacheforFont,
|
||||
getCache,
|
||||
};
|
||||
})();
|
||||
|
Reference in New Issue
Block a user