editor: fix moving widget from the edge (top or left) using keyboard arrows

This commit is contained in:
bordun 2019-09-11 12:08:29 +02:00
parent eba32bcaae
commit 98f04e121a
2 changed files with 9 additions and 3 deletions

View file

@ -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

View file

@ -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 {