Skip to content

Commit

Permalink
Fix position setter
Browse files Browse the repository at this point in the history
  • Loading branch information
hypergonial committed Sep 28, 2023
1 parent b4b7905 commit a16e494
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions docs/source/changelogs/v3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ Versions 3.0+ Changelog

These are all the changelogs for stable releases of hikari-miru (version 3.0.0 to present).

Version 3.2.2
=============

- Fix ``miru.abc.Item.position`` setter max value being it's width instead of row width.

Version 3.2.1
=============

Expand Down
2 changes: 1 addition & 1 deletion miru/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"get_view",
)

__version__ = "3.2.1"
__version__ = "3.2.2"

# MIT License
#
Expand Down
4 changes: 2 additions & 2 deletions miru/abc/item.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ def position(self) -> t.Optional[int]:

@position.setter
def position(self, value: t.Optional[int]) -> None:
if value is None or (self.width - 1) >= value >= 0:
if value is None or 4 >= value >= 0:
self._position = value
else:
raise ValueError(f"Position of item {type(self).__name__} must be between 0 and {self.width-1}.")
raise ValueError(f"Position of item {type(self).__name__} must be between 0 and 4.")

@property
def row(self) -> t.Optional[int]:
Expand Down

0 comments on commit a16e494

Please sign in to comment.