Fix for Druid containers mode

This commit is contained in:
Insality 2025-05-28 23:20:48 +03:00
parent 97942965cd
commit 350770ba9e
4 changed files with 8 additions and 11 deletions

View File

@ -73,10 +73,8 @@ M.REVERSE_PIVOTS = {
M.LAYOUT_MODE = {
STRETCH_X = "stretch_x",
STRETCH_Y = "stretch_y",
ZOOM_MIN = "zoom_min",
ZOOM_MAX = "zoom_max",
FIT = gui.ADJUST_FIT,
STRETCH = gui.ADJUST_STRETCH,
FIT = "fit",
STRETCH = "stretch",
}
M.CURRENT_SYSTEM_NAME = sys.get_sys_info().system_name

View File

@ -44,19 +44,16 @@ end
-- Format: <color={COLOR_NAME}>{Text}</color>
-- Example: <color=FF0000>Rich Text</color>
M.register("color", function(params, settings, style)
params = style.COLORS[params] or params
settings.color = color.get_color(params)
end)
M.register("shadow", function(params, settings, style)
params = style.COLORS[params] or params
settings.shadow = color.get_color(params)
end)
M.register("outline", function(params, settings, style)
params = style.COLORS[params] or params
settings.outline = color.get_color(params)
end)

View File

@ -31,6 +31,8 @@ local CORNER_PIVOTS = {
---@field DRAGGABLE_CORNER_SIZE vector3 Size of box node for debug draggable corners
---@field DRAGGABLE_CORNER_COLOR vector4 Color of debug draggable corners
---@alias druid.container.mode "stretch" | "fit" | "stretch_x" | "stretch_y"
---Druid component to manage the size and positions with other containers relations to create a adaptable layouts.
---
---### Setup
@ -54,7 +56,7 @@ local CORNER_PIVOTS = {
---@field position vector3 The current position
---@field pivot_offset vector3 The pivot offset
---@field center_offset vector3 The center offset
---@field mode string The layout mode
---@field mode druid.container.mode The layout mode
---@field fit_size vector3 The fit size
---@field min_size_x number|nil The minimum size x
---@field min_size_y number|nil The minimum size y

View File

@ -681,7 +681,7 @@ end
local container = require("druid.extended.container")
---Create Container component
---@param node string|node The node_id or gui.get_node(node_id).
---@param mode string|nil Layout mode
---@param mode druid.container.mode|nil Layout mode. Default Fit or Stretch depends from node adjust mode from GUI scene
---@param callback fun(self: druid.container, size: vector3)|nil Callback on size changed
---@return druid.container container The new container component
function M:new_container(node, mode, callback)