From b315ac3c9b85a63b6c2ad644828c9b3f3f849345 Mon Sep 17 00:00:00 2001 From: John Date: Sat, 27 Dec 2014 22:06:03 +0100 Subject: draw rotation center coordinates near crosshairs --- paint.js | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'paint.js') diff --git a/paint.js b/paint.js index 65ae1f6..7e39671 100644 --- a/paint.js +++ b/paint.js @@ -657,6 +657,13 @@ PaintCanvasMorph.prototype.drawcrosshair = function (context) { ctx.strokeStyle = 'black'; ctx.clearRect(0, 0, this.mask.width, this.mask.height); + //draw rotation center coordinates near crosshairs + ctx.globalAlpha = 1; + ctx.fillStyle = "blue"; + ctx.font = "bold 10px Arial"; + var coordinates = -Math.floor((this.mask.width/2 - rp.x)) + ', ' + Math.floor((this.mask.height/2 - rp.y)); + ctx.fillText(coordinates, rp.x + 20, rp.y - 20); + // draw crosshairs: ctx.globalAlpha = 0.5; -- cgit v1.3.1