trying to get coverage analysis to reasonable time
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
-- Lua 5.2+ compatibility for unpack
|
||||
local unpack = table.unpack or unpack
|
||||
|
||||
local Cache = {
|
||||
canvases = {},
|
||||
quads = {},
|
||||
@@ -368,7 +371,9 @@ end
|
||||
--- Initialize Blur module with dependencies
|
||||
---@param deps table Dependencies: { ErrorHandler = ErrorHandler? }
|
||||
function Blur.init(deps)
|
||||
Blur._ErrorHandler = deps.ErrorHandler
|
||||
if type(deps) == "table" then
|
||||
Blur._ErrorHandler = deps.ErrorHandler
|
||||
end
|
||||
end
|
||||
|
||||
Blur.Cache = Cache
|
||||
|
||||
@@ -225,6 +225,35 @@ function Element.new(props)
|
||||
Color = Element._Color,
|
||||
}
|
||||
|
||||
-- Normalize flexDirection: convert "row"→"horizontal", "column"→"vertical"
|
||||
if props.flexDirection == "row" then
|
||||
props.flexDirection = "horizontal"
|
||||
elseif props.flexDirection == "column" then
|
||||
props.flexDirection = "vertical"
|
||||
end
|
||||
|
||||
-- Normalize padding: convert single value to table with all sides
|
||||
if props.padding ~= nil and type(props.padding) ~= "table" then
|
||||
local singleValue = props.padding
|
||||
props.padding = {
|
||||
top = singleValue,
|
||||
right = singleValue,
|
||||
bottom = singleValue,
|
||||
left = singleValue,
|
||||
}
|
||||
end
|
||||
|
||||
-- Normalize margin: convert single value to table with all sides
|
||||
if props.margin ~= nil and type(props.margin) ~= "table" then
|
||||
local singleValue = props.margin
|
||||
props.margin = {
|
||||
top = singleValue,
|
||||
right = singleValue,
|
||||
bottom = singleValue,
|
||||
left = singleValue,
|
||||
}
|
||||
end
|
||||
|
||||
self.children = {}
|
||||
self.onEvent = props.onEvent
|
||||
|
||||
|
||||
@@ -737,7 +737,7 @@ end
|
||||
---@param suggestion string|nil Suggestion
|
||||
function ErrorHandler:_writeLog(level, levelNum, module, code, message, details, suggestion)
|
||||
-- Check if we should log this level
|
||||
if levelNum > self.logLevel then
|
||||
if not levelNum or not self.logLevel or levelNum > self.logLevel then
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
@@ -50,8 +50,8 @@ local AnimationProps = {}
|
||||
---@field backgroundColor Color? -- Background color (default: transparent)
|
||||
---@field cornerRadius number|{topLeft:number?, topRight:number?, bottomLeft:number?, bottomRight:number?}? -- Corner radius: number (all corners) or table for individual corners (default: 0)
|
||||
---@field gap number|string? -- Space between children elements (default: 0)
|
||||
---@field padding {top:number|string?, right:number|string?, bottom:number|string?, left:number|string?, horizontal:number|string?, vertical:number|string?}? -- Padding around children (default: {top=0, right=0, bottom=0, left=0})
|
||||
---@field margin {top:number|string?, right:number|string?, bottom:number|string?, left:number|string?, horizontal:number|string?, vertical:number|string?}? -- Margin around element (default: {top=0, right=0, bottom=0, left=0})
|
||||
---@field padding number|string|{top:number|string?, right:number|string?, bottom:number|string?, left:number|string?, horizontal:number|string?, vertical:number|string?}? -- Padding around children: single value for all sides or table for individual sides (default: {top=0, right=0, bottom=0, left=0})
|
||||
---@field margin number|string|{top:number|string?, right:number|string?, bottom:number|string?, left:number|string?, horizontal:number|string?, vertical:number|string?}? -- Margin around element: single value for all sides or table for individual sides (default: {top=0, right=0, bottom=0, left=0})
|
||||
---@field text string? -- Text content to display (default: nil)
|
||||
---@field textAlign TextAlign? -- Alignment of the text content (default: START)
|
||||
---@field textColor Color? -- Color of the text content (default: black or theme text color)
|
||||
@@ -61,7 +61,7 @@ local AnimationProps = {}
|
||||
---@field fontFamily string? -- Font family name from theme or path to font file (default: theme default or system default, inherits from parent)
|
||||
---@field autoScaleText boolean? -- Whether text should auto-scale with window size (default: true)
|
||||
---@field positioning Positioning? -- Layout positioning mode: "absolute"|"relative"|"flex"|"grid" (default: RELATIVE)
|
||||
---@field flexDirection FlexDirection? -- Direction of flex layout: "horizontal"|"vertical" (default: HORIZONTAL)
|
||||
---@field flexDirection FlexDirection? -- Direction of flex layout: "horizontal"|"vertical"|"row"|"column" (row→horizontal, column→vertical, default: HORIZONTAL)
|
||||
---@field justifyContent JustifyContent? -- Alignment of items along main axis (default: FLEX_START)
|
||||
---@field alignItems AlignItems? -- Alignment of items along cross axis (default: STRETCH)
|
||||
---@field alignContent AlignContent? -- Alignment of lines in multi-line flex containers (default: STRETCH)
|
||||
|
||||
Reference in New Issue
Block a user