From 606a11f19b8302a414bd69abc4ef3cdeb433895c Mon Sep 17 00:00:00 2001 From: Qwreey Date: Mon, 2 Jan 2023 06:57:49 +0900 Subject: [PATCH] feat: now style have low priority --- src/class.lua | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/class.lua b/src/class.lua index 1bbe5eb..7d5aa45 100644 --- a/src/class.lua +++ b/src/class.lua @@ -1,6 +1,7 @@ local module = {}; local pack = table.pack; local match = string.match; +local insert = table.insert; ---@param shared quad_export ---@return quad_module_class @@ -171,9 +172,12 @@ function module.init(shared) elseif indexType == "number" and valueType == "table" and value.__type == "quad_style" then -- style -- style parsing for _,thisStyle in ipairs(parseStyles(value)) do - for styleIndex,styleValue in pairs(thisStyle) do - if type(styleValue) ~= "table" or styleValue.__type ~= "quad_style" then - processQuadProperty(processedProperty,iprop,holder,item,className,styleIndex,styleValue); + if not processedProperty[thisStyle] then + processedProperty[thisStyle] = true; + for styleIndex,styleValue in pairs(thisStyle) do + if type(styleValue) ~= "table" or styleValue.__type ~= "quad_style" then + processQuadProperty(processedProperty,iprop,holder,item,className,styleIndex,styleValue); + end end end end @@ -236,6 +240,11 @@ function module.init(shared) local prop = propsListArray[iprop] if prop then for index,value in pairs(prop) do + if type(index) ~= "number" then + processQuadProperty(processedProperty,iprop,holder,item,ClassName,index,value); + end + end + for index,value in ipairs(prop) do processQuadProperty(processedProperty,iprop,holder,item,ClassName,index,value); end end