Using SVG in GWT

后端 未结 8 840
感动是毒
感动是毒 2021-02-05 12:31

I was wondering if it is possible to include SVG content inside a panel (or whatever would work in GWT), be able to add more to the SVG (like add a circle or a curve) programmat

8条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-05 12:41

    Be warned that SVG will not work in current GWT Shell (Hosted mode) up to 1.6 inclusive, because:

    1) on windows, it uses IE component

    2) on Linux, it uses Firefox 1.0 or equal mozilla runtime, which has no support for SVG.

    Compiled code works fine in non-IE browsers.

    Also, it works regardless of HTML/XHTML in browsers, because in GWT you use createElementNS (you can code method yourself using JSNI). Also, your SVG tag may need width/height attributes (see SVG spec).

提交回复
热议问题