mirror of
https://github.com/Insality/druid.git
synced 2025-06-27 10:27:47 +02:00
#151 Fix text adjust by height
This commit is contained in:
parent
098df24265
commit
d0c91c9cb5
1
druid/base/text.lua
Normal file → Executable file
1
druid/base/text.lua
Normal file → Executable file
@ -86,6 +86,7 @@ local function update_text_area_size(self)
|
|||||||
local max_text_area_square = max_width * max_height
|
local max_text_area_square = max_width * max_height
|
||||||
local cur_text_area_square = metrics.height * metrics.width * self.start_scale.x
|
local cur_text_area_square = metrics.height * metrics.width * self.start_scale.x
|
||||||
scale_modifier = self.start_scale.x * math.sqrt(max_text_area_square / cur_text_area_square)
|
scale_modifier = self.start_scale.x * math.sqrt(max_text_area_square / cur_text_area_square)
|
||||||
|
scale_modifier = math.min(scale_modifier, self.start_scale.x)
|
||||||
end
|
end
|
||||||
|
|
||||||
if self._minimal_scale then
|
if self._minimal_scale then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user