可编辑的SVG文本路径,插入符不跟随文本路径

时间:2019-11-15 11:08:20

标签: javascript html svg

示例:

<div contenteditable="true">
  <svg width="475px" height="235px">
    <path d="M-0.02910236220472441 1 C-0.02910236220472441 115.89618897637797,98.0028661417323 228.6890078740158,240.63023622047245 230.6620157480315 C375.2141102362205 229.67584251968506,475.37981102362215 114.86239370078741,475.37981102362215 0" fill="none" stroke="black" id="a4cf5b94-749b-a1a4-503f-02c0f34ad893-path">
    </path>
    <text>
      <textPath href="#a4cf5b94-749b-a1a4-503f-02c0f34ad893-path">
        <tspan >This is a test
        </tspan> 
        <tspan >This is a test
        </tspan>
      </textPath>
    </text>
  </svg>
</div>   

请参阅https://jsfiddle.net/8p6h0s1w/

尝试编辑文本,您会看到插入符号始终是垂直的,并且不在字母之间。
有没有办法让插入符号正常运行?

0 个答案:

没有答案