{"version":3,"file":"parseSVGFloatAttribute.mjs","sources":["../../../../../src/scene/graphics/shared/svg/parseSVGFloatAttribute.ts"],"sourcesContent":["/**\n * Parses a float value from an SVG element's attribute.\n * This is commonly used for parsing numeric attributes like coordinates, dimensions,\n * and other measurements from SVG elements.\n * @param svg - The SVG element to get the attribute from\n * @param id - The name of the attribute to parse (e.g. 'x', 'y', 'width', etc)\n * @param defaultValue - The value to return if the attribute doesn't exist or can't be parsed\n * @returns The parsed float value, or the default value if parsing fails\n * @example\n * // For SVG: <rect x=\"10.5\" width=\"20\"/>\n * parseSVGFloatAttribute(rectElement, 'x', 0) // Returns 10.5\n * parseSVGFloatAttribute(rectElement, 'y', 0) // Returns 0 since y is not specified\n * @internal\n */\nexport function parseSVGFloatAttribute(svg: SVGElement, id: string, defaultValue: number): number\n{\n    const value = svg.getAttribute(id) as string;\n\n    return value ? Number(value) : defaultValue;\n}\n"],"names":[],"mappings":";AAcO,SAAS,sBAAA,CAAuB,GAAA,EAAiB,EAAA,EAAY,YAAA,EACpE;AACI,EAAA,MAAM,KAAA,GAAQ,GAAA,CAAI,YAAA,CAAa,EAAE,CAAA;AAEjC,EAAA,OAAO,KAAA,GAAQ,MAAA,CAAO,KAAK,CAAA,GAAI,YAAA;AACnC;;;;"}