Skip to content

Commit

Permalink
[arc] Fix ratio calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
IceflowRE committed Jan 15, 2024
1 parent feca564 commit f4860fb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion addons/aspect_ratio_resize_container/plugin.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit f4860fb

Please sign in to comment.