Skip to content

Commit

Permalink
Fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
rsubtil committed Jan 21, 2023
1 parent 532669b commit c64ed95
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion addons/controller_icons/ControllerIcons.gd
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func refresh():
# All it takes is to signal icons to refresh paths
emit_signal("input_type_changed", _last_input_type)

func parse_path(path: String, input_type: int = _last_input_type) -> Texture:
func parse_path(path: String, input_type = _last_input_type) -> Texture:
if typeof(input_type) == TYPE_NIL:
return null
var root_paths := _expand_path(path, input_type)
Expand Down
1 change: 1 addition & 0 deletions addons/controller_icons/example/IconRemapper.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

[node name="Control" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 100.0
Expand Down
3 changes: 2 additions & 1 deletion addons/controller_icons/example/IconTest.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ grow_horizontal = 2
grow_vertical = 2

[node name="ControllerButton" type="Button" parent="."]
layout_mode = 0
offset_left = 282.0
offset_top = 44.0
offset_right = 469.0
Expand All @@ -31,7 +32,6 @@ path = "ui_left"
position = Vector2(359, 229)
texture = ExtResource("3")
script = ExtResource("4_yv7se")
path = "ui_up"

[node name="ControllerSprite3D" type="Sprite3D" parent="."]
texture = ExtResource("5")
Expand All @@ -40,6 +40,7 @@ path = "ui_right"

[node name="ControllerTextureRect" type="TextureRect" parent="."]
custom_minimum_size = Vector2(40, 40)
layout_mode = 0
offset_left = 675.0
offset_top = 106.0
offset_right = 775.0
Expand Down
4 changes: 2 additions & 2 deletions addons/controller_icons/objects/TextureRect.gd
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ class_name ControllerTextureRect
max_width = _max_width
if is_inside_tree():
if max_width < 0:
ignore_texture_size = false
expand_mode = TextureRect.EXPAND_KEEP_SIZE
else:
ignore_texture_size = true
expand_mode = TextureRect.EXPAND_IGNORE_SIZE
custom_minimum_size.x = max_width
if texture:
custom_minimum_size.y = texture.get_height() * max_width / texture.get_width()
Expand Down

0 comments on commit c64ed95

Please sign in to comment.