mirror of
https://github.com/openstf/stf
synced 2025-10-05 02:29:26 +02:00
16 lines
366 B
JavaScript
16 lines
366 B
JavaScript
function CanvasRender(options, canvasElement) {
|
|
this.options = options
|
|
this.context = canvasElement.getContext('2d')
|
|
}
|
|
|
|
CanvasRender.prototype.draw = function (image) {
|
|
this.context.drawImage(image, 0, 0)
|
|
}
|
|
|
|
CanvasRender.prototype.clear = function () {
|
|
var width = 300
|
|
var height = 300
|
|
ctx.clearRect(0, 0, width, height)
|
|
}
|
|
|
|
module.exports = CanvasRender
|