This commit is contained in:
Insality
2025-03-20 09:59:45 +02:00
parent 330dabda09
commit fb9c80b284
12 changed files with 15 additions and 397695 deletions

View File

@@ -175,17 +175,17 @@ end
---@param scale number
function M:set_scale(scale)
local current_scale_x = gui.get(self.node, helper.PROP_SCALE_X)
local current_scale_y = gui.get(self.node, helper.PROP_SCALE_Y)
local current_size_x = gui.get(self.node, helper.PROP_SIZE_X)
local current_size_y = gui.get(self.node, helper.PROP_SIZE_Y)
local current_scale_x = gui.get(self.node, M.PROP_SCALE_X)
local current_scale_y = gui.get(self.node, M.PROP_SCALE_Y)
local current_size_x = gui.get(self.node, M.PROP_SIZE_X)
local current_size_y = gui.get(self.node, M.PROP_SIZE_Y)
local delta_scale_x = scale / current_scale_x
local delta_scale_y = scale / current_scale_y
gui.set(self.node, helper.PROP_SCALE_X, scale)
gui.set(self.node, helper.PROP_SCALE_Y, scale)
gui.set(self.node, helper.PROP_SIZE_X, current_size_x / delta_scale_x)
gui.set(self.node, helper.PROP_SIZE_Y, current_size_y / delta_scale_y)
gui.set(self.node, M.PROP_SCALE_X, scale)
gui.set(self.node, M.PROP_SCALE_Y, scale)
gui.set(self.node, M.PROP_SIZE_X, current_size_x / delta_scale_x)
gui.set(self.node, M.PROP_SIZE_Y, current_size_y / delta_scale_y)
return self
end

View File

@@ -8,10 +8,10 @@ local M = {}
function M:init()
self.root = self:get_node("root")
self.text_name = self.druid:new_text("text_name")
:set_text_adjust("scale_when_trim_left", 0.3)
:set_text_adjust("scale_then_trim_left", 0.3)
self.text_right = self.druid:new_text("text_right", "")
--:set_text_adjust("scale_when_trim_left", 0.3) -- TODO: not works? why?
--:set_text_adjust("scale_then_trim_left", 0.3) -- TODO: not works? why?
self.container = self.druid:new_container(self.root)
self.container:add_container("text_name", nil, function(_, size)