From b6ba39f727f245905029b254c6a22c4b2ec490cc Mon Sep 17 00:00:00 2001 From: William Toohey Date: Wed, 3 Feb 2016 21:48:25 +1000 Subject: [PATCH] Fix handle drag alignment --- src/js/HuesEditor.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/js/HuesEditor.js b/src/js/HuesEditor.js index 9e6ab0a..34ce676 100644 --- a/src/js/HuesEditor.js +++ b/src/js/HuesEditor.js @@ -519,10 +519,11 @@ HuesEditor.prototype.uiCreateEditArea = function() { handleContainer.addEventListener("mousedown", (e) => { e.preventDefault(); + var editTop = this.editArea.getBoundingClientRect().top; + var handleSize = this.resizeHandle.clientHeight; var resizer = (e) => { - var editTop = this.editArea.getBoundingClientRect().top; - this.buildEditSize = Math.floor(e.clientY - editTop); + this.buildEditSize = Math.floor(e.clientY - editTop + handleSize/2); this.resize(); };