editor: % fix

This commit is contained in:
bordun 2020-09-07 10:06:09 +02:00
parent d14859668a
commit 3fd0771c05

View file

@ -540,13 +540,13 @@ class Editor {
let top = pastedData[i].top,
left = pastedData[i].left
if (top.includes('%')) {
if (typeof top === 'string' && top.includes('%')) {
top = parseFloat(top) / 100 * this.selectedWidgets[0].widget.offsetHeight
pastedData[i]._atop = top
pastedData[i]._ptop = true
}
if (left.includes('%')) {
if (typeof left === 'string' && left.includes('%')) {
left = parseFloat(left) / 100 * this.selectedWidgets[0].widget.offsetWidth
pastedData[i]._aleft = left
pastedData[i]._pleft = true