fabric
Version:
Object model for HTML5 canvas, and SVG-to-canvas parser. Backed by jsdom and node-canvas.
16 lines (15 loc) • 600 B
JavaScript
import { Group } from "../../shapes/Group.mjs";
//#region src/util/misc/groupSVGElements.ts
/**
* TODO experiment with different layout manager and svg results ( fixed fit content )
* Groups SVG elements (usually those retrieved from SVG document)
* @param {FabricObject[]} elements FabricObject(s) parsed from svg, to group
* @return {FabricObject | Group}
*/
const groupSVGElements = (elements, options) => {
if (elements && elements.length === 1) return elements[0];
return new Group(elements, options);
};
//#endregion
export { groupSVGElements };
//# sourceMappingURL=groupSVGElements.mjs.map