据说DOMException - with error code NOT_SUPPORTED_ERR if the requested trait is not supported on this element or null.
我正在尝试水平翻转我的 SVG 图像,但我遇到了这个错误。
InputStream svgStream = getClass().getResourceAsStream(path);
SVGImage svgImage = (SVGImage) (SVGImage.createImage(svgStream, null));
SVGSVGElement myEl = (SVGSVGElement) svgImage.getDocument().getDocumentElement());
SVGMatrix transformMatrix = myEl.getScreenCTM();
transformMatrix = transformMatrix.mTranslate(100f, 0f);
myEl.setMatrixTrait("transform", transformMatrix);