Skip to content

Instantly share code, notes, and snippets.

@mikekavouras
Created November 24, 2016 04:10
Show Gist options
  • Save mikekavouras/be69a561fe08d92c6a2644b123be99cb to your computer and use it in GitHub Desktop.
Save mikekavouras/be69a561fe08d92c6a2644b123be99cb to your computer and use it in GitHub Desktop.
function(t) {
var i,
n,
s = this.brush.img.width * this.scale,
e = this.brush.img.height * this.scale,
h = {
x: this.pointer.x,
y: this.pointer.y
};
this.pointPosition(t);
for (var o = {
x: this.pointer.x,
y: this.pointer.y
}, a = this.pointDistance(h, o), r = this.pointAngle(h, o), c = 0; c <= a || 0 === c; c++)
i = h.x + Math.sin(r) * c - s / 2, n = h.y + Math.cos(r) * c - e / 2, this.context.drawImage(this.brush.img, i, n, s, e)
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment