ait-canvas
Advanced tools
Comparing version 0.5.2 to 0.6.0
47
index.js
@@ -156,2 +156,6 @@ const { | ||
function isPointInPath([x, y]) { | ||
unwrap(lookup(this, CTX)).isPointInStroke(x, y); | ||
} | ||
function closePath() { | ||
@@ -192,7 +196,7 @@ unwrap(lookup(this, CTX)).closePath(); | ||
function createLinearGradient([x2, y2], [x1, y1]) { | ||
return this.ctx.createLinearGradient(x1, y1, x2, y2); | ||
return unwrap(lookup(this, CTX)).createLinearGradient(x1, y1, x2, y2); | ||
} | ||
function createRadialGradient(r2, [x2, y2], r1, [x1, y1]) { | ||
return this.ctx.createRadialGradient(x1, y1, r1, x2, y2, r2); | ||
return unwrap(lookup(this, CTX)).createRadialGradient(x1, y1, r1, x2, y2, r2); | ||
} | ||
@@ -205,2 +209,24 @@ | ||
function getImageData(height, width, [sx, sy]) { | ||
return unwrap(lookup(this, CTX)).getImageData(sx, sy, width, height); | ||
} | ||
function putImageData( | ||
dirtyHeight, | ||
dirtyWidth, | ||
[dirtyX, dirtyY], | ||
[dx, dy], | ||
image | ||
) { | ||
return unwrap(lookup(this, CTX)).putImageData( | ||
image, | ||
dx, | ||
dy, | ||
dirtyX, | ||
dirtyY, | ||
dirtyWidth, | ||
dirtyHeight | ||
); | ||
} | ||
module.exports = { | ||
@@ -235,2 +261,3 @@ canvasContext: aitFFI__F(1, 'canvasContext', canvasContext), | ||
isPointInPath: aitFFI__F(1, 'isPointInPath', unwrapper(isPointInPath)), | ||
isPointInStroke: aitFFI__F(1, 'isPointInStroke', unwrapper(isPointInStroke)), | ||
fill: aitFFI__F(0, 'fill', fill), | ||
@@ -253,3 +280,17 @@ save: aitFFI__F(0, 'save', save), | ||
createRadialGradient: aitFFI__F(4, 'createRadialGradient', createRadialGradient), | ||
addColorStop: aitFFI__F(3, 'addColorStop', addColorStop) | ||
addColorStop: aitFFI__F(3, 'addColorStop', addColorStop), | ||
// fillText, | ||
// strokeText, | ||
// measureText, // only return .width | ||
// font, | ||
// textAlign, | ||
// textBaseline, | ||
// direction, | ||
// getLineDash, | ||
// setLineDash, | ||
// lineDashOffset, | ||
// drawImage, | ||
// createImageData, | ||
getImageData: aitFFI__F(3, 'getImageData', getImageData), | ||
putImageData: aitFFI__F(5, 'putImageData', putImageData) | ||
}; |
{ | ||
"name": "ait-canvas", | ||
"version": "0.5.2", | ||
"version": "0.6.0", | ||
"description": "Ait module with html canvas bindings", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12031
291
1