From 8bd599f0491d2a4eda6b39b79cb75e747b95ebdc Mon Sep 17 00:00:00 2001 From: bordun Date: Wed, 11 Sep 2019 12:08:29 +0200 Subject: [PATCH] editor: fix moving widget from the edge (top or left) using keyboard arrows --- CHANGELOG.md | 8 +++++++- src/client/app/editor/index.js | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ee901e96..d736e222 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,11 +2,17 @@ ## 0.47.5 + +- bug fixes + - package: broken build from sources on Windows + - editor: incorrect position when moving a widget from an edge with the keyboard + - widgets - frames: allow loading local html files without requiring a web server to serve them - text: escape html tags characters (`<` & `>`) - input: added `asYouType` property - + + ## 0.47.4 - bug fixes diff --git a/src/client/app/editor/index.js b/src/client/app/editor/index.js index d377864f..db68e7d0 100644 --- a/src/client/app/editor/index.js +++ b/src/client/app/editor/index.js @@ -725,13 +725,13 @@ var Editor = class Editor { for (var w of this.selectedWidgets) { - var newTop = w.container.offsetTop / PXSCALE + deltaY + var newTop = parseInt(w.container.offsetTop) / PXSCALE + deltaY if (typeof w.props.top === 'string' && w.props.top.indexOf('%') > -1) { w.props.top = (100 * PXSCALE * newTop / w.container.parentNode.offsetHeight).toFixed(2) + '%' } else { w.props.top = newTop } - var newLeft = w.container.offsetLeft / PXSCALE + deltaX + var newLeft = parseInt(w.container.offsetLeft) / PXSCALE + deltaX if (typeof w.props.left === 'string' && w.props.left.indexOf('%') > -1) { w.props.left = (100 * PXSCALE * newLeft / w.container.parentNode.offsetWidth).toFixed(2) + '%' } else {