Commit 695f22b7 authored by limingzhe's avatar limingzhe

fix: 斜圈展示

parent 422dcecd
No preview for this file type
{"ver":"1.1.2","uuid":"62f3ac14-b21c-45c1-adfc-93c1ec87ab00","isBundle":false,"bundleName":"","priority":1,"compressionType":{},"optimizeHotUpdate":{},"inlineSpriteFrames":{},"isRemoteBundle":{"ios":false,"android":false},"subMetas":{}}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "62f3ac14-b21c-45c1-adfc-93c1ec87ab00",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {
"ios": false,
"android": false
},
"subMetas": {}
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -18,24 +18,24 @@ export function getAngleByPos(px, py, mx, my) {
const radina = Math.acos(cos); // 用反三角函数求弧度
let angle = Math.floor(180 / (Math.PI / radina) * 100) / 100; // 将弧度转换成角度
if (mx > px && my > py) {// 鼠标在第四象限
angle = 180 - angle;
}
if (mx === px && my > py) {// 鼠标在y轴负方向上
angle = 180;
}
if (mx > px && my === py) {// 鼠标在x轴正方向上
angle = 90;
}
if (mx < px && my > py) {// 鼠标在第三象限
angle = 180 + angle;
}
if (mx < px && my === py) {// 鼠标在x轴负方向
angle = 270;
}
if (mx < px && my < py) {// 鼠标在第二象限
angle = 360 - angle;
}
// if (mx > px && my > py) {// 鼠标在第四象限
// angle = 180 - angle;
// }
// if (mx === px && my > py) {// 鼠标在y轴负方向上
// angle = 180;
// }
// if (mx > px && my === py) {// 鼠标在x轴正方向上
// angle = 90;
// }
// if (mx < px && my > py) {// 鼠标在第三象限
// angle = 180 + angle;
// }
// if (mx < px && my === py) {// 鼠标在x轴负方向
// angle = 270;
// }
// if (mx < px && my < py) {// 鼠标在第二象限
// angle = 360 - angle;
// }
// console.log('angle: ', angle);
return angle;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment