This commit is contained in:
2026-01-06 19:05:48 +11:00
commit 419b6bc7a1
6 changed files with 2521 additions and 0 deletions

22
svg_utils.go Normal file
View File

@@ -0,0 +1,22 @@
package gliffy2drawio
import (
"regexp"
)
// SVGImporterUtils mirrors the Java helper but keeps a lightweight implementation.
// It currently preserves the original SVG and only updates the viewBox attribute
// if one is present.
type SVGImporterUtils struct {
}
var svgPattern = regexp.MustCompile(`viewBox="(.*?)"`)
func (s SVGImporterUtils) SetViewBox(svg string) string {
m := svgPattern.FindStringSubmatch(svg)
if len(m) == 0 {
return svg
}
// No bounding-box calculation available here; keep the existing viewBox.
return svg
}