fix(ui): do not floor bbox calc, it cuts off the last pixels

This commit is contained in:
psychedelicious 2024-07-05 11:11:03 +10:00
parent 91a420b13e
commit 2f21a2220d

View File

@ -188,12 +188,7 @@ const getLayerBboxPixels = (
*/ */
export const getNodeBboxFast = (node: Konva.Node): IRect => { export const getNodeBboxFast = (node: Konva.Node): IRect => {
const bbox = node.getClientRect(GET_CLIENT_RECT_CONFIG); const bbox = node.getClientRect(GET_CLIENT_RECT_CONFIG);
return { return bbox;
x: Math.floor(bbox.x),
y: Math.floor(bbox.y),
width: Math.floor(bbox.width),
height: Math.floor(bbox.height),
};
}; };
const filterRGChildren = (node: Konva.Node): boolean => node.name() === RG_LAYER_OBJECT_GROUP_NAME; const filterRGChildren = (node: Konva.Node): boolean => node.name() === RG_LAYER_OBJECT_GROUP_NAME;