Skip to content

Commit

Permalink
test: #50
Browse files Browse the repository at this point in the history
  • Loading branch information
army8735 committed May 30, 2020
1 parent 4d4b3d4 commit 39551ae
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 6 deletions.
9 changes: 7 additions & 2 deletions index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion index.js.map

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion src/math/geom.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,11 @@ export default {
r2d(n) {
return n * 180 / Math.PI;
},
H: 4 * (Math.sqrt(2) - 1) / 3, // 贝塞尔曲线模拟1/4圆
// 贝塞尔曲线模拟1/4圆弧比例
H: 4 * (Math.sqrt(2) - 1) / 3,
// <90任意角度贝塞尔曲线拟合圆弧的比例公式
h(deg) {
deg *= 0.5;
return 4 * ((1 - Math.cos(deg)) / Math.sin(deg)) / 3;
},
};
2 changes: 1 addition & 1 deletion test/border-radius-bgc-px-svg/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = {
browser
.url('file://' + path.join(__dirname, 'index.html'))
.waitForElementVisible('body', 1000)
.assert.value('input', '<svg width="360" height="360"><defs></defs><g></g><g><g><g><path d="M0,0L90,0C95.52284749830794,0,100,4.477152501692064,100,10L100,80C100,91.04569499661588,91.04569499661588,100,80,100L40,100C17.908610006768257,100,0,82.09138999323174,0,60L0,30C0,13.431457505076192,13.431457505076192,0,30,0" fill="rgba(255,0,0,1)"></path></g><g></g></g></g></svg>')
.assert.value('input', '<svg width="360" height="360"><defs></defs><g></g><g><g><g><path d="M0,30C0,13.431457505076192,13.431457505076192,0,30,0L90,0C95.52284749830794,0,100,4.477152501692064,100,10L100,80C100,91.04569499661588,91.04569499661588,100,80,100L40,100C17.908610006768257,100,0,82.09138999323174,0,60" fill="rgba(255,0,0,1)"></path></g><g></g></g></g></svg>')
.end();
}
};
2 changes: 1 addition & 1 deletion test/border-radius-img-svg/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = {
browser
.url('file://' + path.join(__dirname, 'index.html'))
.waitForElementVisible('body', 1000)
.assert.value('input', '<svg width="360" height="360"><defs><mask id="karas-defs-0-0"><path d="M0,0L90,0C95.52284749830794,0,100,4.477152501692064,100,10L100,90C100,95.52284749830794,95.52284749830794,100,90,100L10,100C4.477152501692064,100,0,95.52284749830794,0,90L0,10C0,4.477152501692064,4.477152501692064,0,10,0" fill="#FFF"></path></mask></defs><g></g><g><g><g></g><g><image xlink:href="../image.png" x="0" y="0" width="100" height="100" mask="url(#karas-defs-0-0)"></image></g></g></g></svg>')
.assert.value('input', '<svg width="360" height="360"><defs><mask id="karas-defs-0-0"><path d="M0,10C0,4.477152501692064,4.477152501692064,0,10,0L90,0C95.52284749830794,0,100,4.477152501692064,100,10L100,90C100,95.52284749830794,95.52284749830794,100,90,100L10,100C4.477152501692064,100,0,95.52284749830794,0,90" fill="#FFF"></path></mask></defs><g></g><g><g><g></g><g><image xlink:href="../image.png" x="0" y="0" width="100" height="100" mask="url(#karas-defs-0-0)"></image></g></g></g></svg>')
.end();
}
};

0 comments on commit 39551ae

Please sign in to comment.