first commit
This commit is contained in:
9
frontend/node_modules/antd/es/float-button/util.js
generated
vendored
Normal file
9
frontend/node_modules/antd/es/float-button/util.js
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
const getOffset = radius => {
|
||||
if (radius === 0) {
|
||||
return 0;
|
||||
}
|
||||
// 如果要考虑通用性,这里应该用三角函数 Math.sin(45)
|
||||
// 但是这个场景比较特殊,始终是等腰直角三角形,所以直接用 Math.sqrt() 开方即可
|
||||
return radius - Math.sqrt(Math.pow(radius, 2) / 2);
|
||||
};
|
||||
export default getOffset;
|
||||
Reference in New Issue
Block a user