misc: avoid some more errors with malformed properties vs match() that expects strings

This commit is contained in:
jean-emmanuel 2022-02-08 08:54:37 +01:00
parent 0cf8d1e42f
commit b0e9642af7
3 changed files with 7 additions and 6 deletions

View file

@ -167,12 +167,13 @@ class UiDragResize extends UiWidget {
updateRectangle() {
var widgets = this.widgets,
widget = widgets[0]
widget = widgets[0],
layout = String(widget.parent.getProp('layout'))
var handlesVisibility = [
widget.parent.getProp('layout') === 'default', // nw
widget.parent.getProp('layout').match(/horizontal|default/), // e
widget.parent.getProp('layout').match(/vertical|default/), // s
layout === 'default', // nw
layout.match(/horizontal|default/), // e
layout.match(/vertical|default/), // s
]
handlesVisibility.push(handlesVisibility[1] && handlesVisibility[2]) // se