Giter VIP home page Giter VIP logo

Comments (10)

dntzhang avatar dntzhang commented on August 27, 2024

会 %360 啊。所以处理一下~~

from phytouch.

liuzhibin123 avatar liuzhibin123 commented on August 27, 2024

没明白你意思 是 if(this.img.rotateZ % 360){
this.img.rotateZ += 45
}
能具体写写吗?

from phytouch.

dntzhang avatar dntzhang commented on August 27, 2024

仔细试了一把。感觉是 transition+matrix3d的坑,看下要不要chrome团队提issue~~

from phytouch.

imyzf avatar imyzf commented on August 27, 2024

@dntzhang 你好!我也遇到了一样的问题,观察了一下生成的矩阵,发现出现2e-153e-15之类的值时,会逆向旋转。

有点不太理解这段代码,不知道是不是有问题:

    _rounded: function (value, i) {
      i = Math.pow(10, i || 15);
      // default
      return Math.round(value * i) / i;
    },

我改成这样子以后,2e-15之类的值返回0,rotateZ就没问题了,但是rotataY还是有问题

    _rounded: function (value) {
      return Math.abs(value) < 1e-14 ? 0 : value
    },

from phytouch.

dntzhang avatar dntzhang commented on August 27, 2024

收到,多谢。我看下 ~ @imyzf

from phytouch.

imyzf avatar imyzf commented on August 27, 2024

另外我发现如果%360就不会有2e-15出现

rotateZ = 1890
[0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]

rotateZ = 1980
[-1, -2e-15, 0, 0, 2e-15, -1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]

结合transition,从1890度到1980度会逆向旋转

from phytouch.

liuzhibin123 avatar liuzhibin123 commented on August 27, 2024

怎么样,最后这个问题有解决吗 , 还是无解?

from phytouch.

dntzhang avatar dntzhang commented on August 27, 2024

没有解决。规避的方式是操作rotate属性的时候不要和css transition 一起使用~~,和 js 定时器或者requestAnimationFrame 一起使用是ok的。要去翻 webkit 源码了~~

from phytouch.

xluos avatar xluos commented on August 27, 2024

同样遇到这个问题

from phytouch.

dntzhang avatar dntzhang commented on August 27, 2024

不要和transition一起使用

from phytouch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.