From 4a51ff4215b878e3566ca838984494f65a67790b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Thu, 2 Jun 2011 14:33:42 +0100 Subject: [PATCH 1/6] Remove unneeded blend mode. --- src/util/BlendMode.js | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/util/BlendMode.js b/src/util/BlendMode.js index c2a1d256..5f4b7e3c 100644 --- a/src/util/BlendMode.js +++ b/src/util/BlendMode.js @@ -203,13 +203,6 @@ var BlendMode = { db = (bb + sb) / 2; }, - 'pin-light': function() { - var op = sr < 128 ? min : max; - dr = op(sr, br); - dg = op(sg, bg); - db = op(sb, bb); - }, - negation: function() { dr = 255 - abs(255 - sr - br); dg = 255 - abs(255 - sg - bg); From 016476d1dc952b2bb3e98af46ec1f4d79cb90508 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Thu, 2 Jun 2011 15:33:30 +0100 Subject: [PATCH 2/6] Make sure mousemove events have lastPoint set even for the first move so event.delta is always defined for them. --- src/tool/Tool.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/tool/Tool.js b/src/tool/Tool.js index 8b1d2058..73e4ebf6 100644 --- a/src/tool/Tool.js +++ b/src/tool/Tool.js @@ -293,7 +293,9 @@ var Tool = this.Tool = Base.extend({ if (needsChange && pt.equals(this._point)) return false; } - this._lastPoint = this._point; + // Make sure mousemove events have lastPoint set even for the first move + // so event.delta is always defined for them. + this._lastPoint = first && type == 'mousemove' ? pt : this._point; this._point = pt; switch (type) { case 'mousedown': From a1cbd53e23054f9d190514b7dc2867b163a6a887 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Thu, 2 Jun 2011 15:33:46 +0100 Subject: [PATCH 3/6] Use modulo again in hsb conversion. --- src/color/Color.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/color/Color.js b/src/color/Color.js index 3629a7f1..e9053b5d 100644 --- a/src/color/Color.js +++ b/src/color/Color.js @@ -98,7 +98,7 @@ var Color = this.Color = Base.extend(new function() { }, 'hsb-rgb': function(color) { - var h = color._hue / 60, // Scale to 0..6 + var h = (color._hue / 60) % 6, // Scale to 0..6 s = color._saturation, b = color._brightness, i = Math.floor(h), // 0..5 From 419514a7b07af4fa6767e922570c79eaca68f88b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Thu, 2 Jun 2011 15:34:28 +0100 Subject: [PATCH 4/6] Ignore local build files. --- build/.gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 build/.gitignore diff --git a/build/.gitignore b/build/.gitignore new file mode 100644 index 00000000..3c283040 --- /dev/null +++ b/build/.gitignore @@ -0,0 +1 @@ +/scriptographer.sh From 2ab7568d5d47a6ee002754a2434e3033203329c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Thu, 2 Jun 2011 15:36:44 +0100 Subject: [PATCH 5/6] Fix typo. --- src/tool/Tool.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tool/Tool.js b/src/tool/Tool.js index 73e4ebf6..2fb27d90 100644 --- a/src/tool/Tool.js +++ b/src/tool/Tool.js @@ -295,7 +295,7 @@ var Tool = this.Tool = Base.extend({ } // Make sure mousemove events have lastPoint set even for the first move // so event.delta is always defined for them. - this._lastPoint = first && type == 'mousemove' ? pt : this._point; + this._lastPoint = start && type == 'mousemove' ? pt : this._point; this._point = pt; switch (type) { case 'mousedown': From 99e4cc764579ad25cbe1cf0d9d5db15de56f8374 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Thu, 2 Jun 2011 15:38:12 +0100 Subject: [PATCH 6/6] Add TODO comment about mousedown events not having delta set the first time. --- src/tool/Tool.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tool/Tool.js b/src/tool/Tool.js index 2fb27d90..6b924feb 100644 --- a/src/tool/Tool.js +++ b/src/tool/Tool.js @@ -295,6 +295,7 @@ var Tool = this.Tool = Base.extend({ } // Make sure mousemove events have lastPoint set even for the first move // so event.delta is always defined for them. + // TODO: Decide wether mousedown also should always have delta set. this._lastPoint = start && type == 'mousemove' ? pt : this._point; this._point = pt; switch (type) {