From f4860fb85aad76f0a89852194319593d90186ff1 Mon Sep 17 00:00:00 2001 From: Iceflower Date: Mon, 15 Jan 2024 23:21:16 +0100 Subject: [PATCH] [arc] Fix ratio calculation --- README.md | 4 ++++ .../aspect_ratio_resize_container.gd | 4 ++-- addons/aspect_ratio_resize_container/plugin.cfg | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 68ff275..917eca9 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,10 @@ You are also not able to use the property `custom_minimum_size` anymore as it is ### Changelog +#### 3.2.0 + +- Fix ratio calculation (but it's still bugged in some cases) + #### 3.1.2 - Use absolute paths in preloads diff --git a/addons/aspect_ratio_resize_container/aspect_ratio_resize_container.gd b/addons/aspect_ratio_resize_container/aspect_ratio_resize_container.gd index a95bc2d..032e7e1 100644 --- a/addons/aspect_ratio_resize_container/aspect_ratio_resize_container.gd +++ b/addons/aspect_ratio_resize_container/aspect_ratio_resize_container.gd @@ -26,8 +26,8 @@ func _get_minimum_size() -> Vector2: var min_size: Vector2 = self._get_children_min_size() if self.stretch_mode == STRETCH_WIDTH_CONTROLS_HEIGHT: var width: float = maxf(min_size.x, self.size.x) - min_size.y = width * self.ratio + min_size.y = width * 1 / self.ratio elif self.stretch_mode == STRETCH_HEIGHT_CONTROLS_WIDTH: var height: float = maxf(min_size.y, self.size.y) - min_size.x = height * self.ratio + min_size.x = height * 1 / self.ratio return min_size diff --git a/addons/aspect_ratio_resize_container/plugin.cfg b/addons/aspect_ratio_resize_container/plugin.cfg index 9dad533..4829153 100644 --- a/addons/aspect_ratio_resize_container/plugin.cfg +++ b/addons/aspect_ratio_resize_container/plugin.cfg @@ -3,7 +3,7 @@ name="Aspect Ratio Resize Container" description="Extending `AspectRatioContainer` and update it's own minimum size based on the children." author="Iceflower S" -version="3.1.2" +version="3.2.0" script="plugin.gd" license="MIT" repository="https://github.com/kenyoni-software/godot-addons"