How to make object rotate with drag, how to get a rotate point around the origin use sin or cos?

后端 未结 2 1989
粉色の甜心
粉色の甜心 2021-02-03 11:48

I\'ve been searching long time, but can\'t find a better way solve my problem,
make div draggable, rotate and resize by each handle like these 2 example 1 2,, now it can be

2条回答
  •  悲哀的现实
    2021-02-03 12:32

    They use a matrix function in a transform properties. You can rotate element by muliplay your matrix (element coordinates) by rotation matrix.

    transform:  matrix(a, c, b, d, tx, ty)
    

    More info and examples here: The CSS3 matrix() Transform for the Mathematically Challenged

提交回复
热议问题