Path2D.addPath被删除了吗? [英] Path2D.addPath got removed?

查看:212
本文介绍了Path2D.addPath被删除了吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用Path2D已有一段时间了,但是现在看来它的功能Path2D.addPath(path, matrix?)被删除了(至少在chrome中).

I have been working with Path2D for a while, but now it seems like it's function Path2D.addPath(path, matrix?) got removed (at least in chrome).

实际上有替代品吗?
它是永久的,还是只是浏览器部分的错误?

Is there actually any replacement?
Is it permanent, or just a mistake on browser part?

推荐答案

这是有关来自MDN(和无耻插件)的addPath的信息:

This is the information on addPath from MDN (and shameless plug):

"addPath" (注意:EXPERIMENTAL,在标准曲目)

"addPath" (NOTE: EXPERIMENTAL, on standard track)

  DESKTOP:
  Chrome  | Firefox | Edge    | IE      | Opera   | Safari
  --------+---------+---------+---------+---------+----------
    Yes   |    34   |     -   |     -   |   Yes   |   Yes

  MOBILE:
  Android | Chrome  | Edge    | Firefox | Opera   | Safari
  --------+---------+---------+---------+---------+----------
    Yes   |   Yes   |     -   |    34   |   Yes   |   Yes

Data from MDN - 'npm i -g mdncomp' by K3N / epistemex.com (c) 2018.

但是您是对的,它似乎已经脱离了当前Chrome版本中的原型.我的猜测是,这与更改API 使用DOMMatrix而不是SVGMatrix,尽管现在应该已经到位,并且在

But you're right, it seem to be gone from the prototype in current Chrome version(s). My guess is that it is related to changing the API to use DOMMatrix instead of SVGMatrix, though by now that should be in place and there is currently nothing to be found at bugs.chromium.org. In any case, we're left to wait for an update.

除了将路径直接添加到上下文之外,没有其他好的解决方法.如果范围受到限制,您也许可以使用辅助上下文并从那里画回路径. polyfill方法将是广泛的,因为您需要重建整个Path2D API才能访问路径信息.

There are no good workarounds for this besides from adding the path directly to context. If the scope is limited you might be able to use a secondary context and draw the paths back in from there. A polyfill approach will be extensive as you would need to rebuild the entire Path2D API to get access to the path information.

这篇关于Path2D.addPath被删除了吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆