mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-05-17 15:11:04 +00:00
29 lines
757 B
JavaScript
29 lines
757 B
JavaScript
/*!
|
|
{
|
|
"name": "canvas winding support",
|
|
"property": "canvaswinding",
|
|
"tags": ["canvas"],
|
|
"notes": [{
|
|
"name": "Article",
|
|
"href": "https://web.archive.org/web/20170825024655/http://blogs.adobe.com/webplatform/2013/01/30/winding-rules-in-canvas/"
|
|
}]
|
|
}
|
|
!*/
|
|
/* DOC
|
|
Determines if winding rules, which controls if a path can go clockwise or counterclockwise
|
|
*/
|
|
define(['Modernizr', 'createElement', 'test/canvas'], function(Modernizr, createElement) {
|
|
|
|
Modernizr.addTest('canvaswinding', function() {
|
|
if (Modernizr.canvas === false) {
|
|
return false;
|
|
}
|
|
var ctx = createElement('canvas').getContext('2d');
|
|
|
|
ctx.rect(0, 0, 10, 10);
|
|
ctx.rect(2, 2, 6, 6);
|
|
return ctx.isPointInPath(5, 5, 'evenodd') === false;
|
|
});
|
|
|
|
});
|