From f46adb6724bccc39cbb3f3723f29724dfb600395 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Thu, 24 Oct 2024 21:52:56 +0300 Subject: [PATCH] fix changing valtype to shadow breaking everything in its wake --- .../settings_modal/tabs/style_tab/style_tab.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/components/settings_modal/tabs/style_tab/style_tab.js b/src/components/settings_modal/tabs/style_tab/style_tab.js index 08eb6d57..2fe63dd8 100644 --- a/src/components/settings_modal/tabs/style_tab/style_tab.js +++ b/src/components/settings_modal/tabs/style_tab/style_tab.js @@ -616,16 +616,23 @@ export default { return virtualDirectives[selectedVirtualDirectiveId.value].valType }, set (value) { - virtualDirectives[selectedVirtualDirectiveId.value].valType = value + const newValType = value + let newValue switch (value) { case 'shadow': - virtualDirectives[selectedVirtualDirectiveId.value].value = '0 0 0 #000000' + newValue = '0 0 0 #000000 / 1' break case 'color': - virtualDirectives[selectedVirtualDirectiveId.value].value = '#000000' + newValue = '#000000' break default: - virtualDirectives[selectedVirtualDirectiveId.value].value = 'none' + newValue = 'none' + } + const newName = virtualDirectives[selectedVirtualDirectiveId.value].name + virtualDirectives[selectedVirtualDirectiveId.value] = { + name: newName, + value: newValue, + valType: newValType } } })