Skip to content

Commit

Permalink
fix: примыкание соседних прямоугольников
Browse files Browse the repository at this point in the history
  • Loading branch information
ShashkovS committed Nov 14, 2024
1 parent 2973628 commit cf9d734
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: ci
name: docs
on:
push:
branches:
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,13 @@ def run(self):
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.13',
'Programming Language :: Python :: Implementation :: CPython',
'Topic :: Multimedia :: Graphics',
],
# $ setup.py publish support.
cmdclass={
Expand Down
2 changes: 1 addition & 1 deletion src/drawzero/__about__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"__copyright__",
]

__version__ = '0.4.4'
__version__ = '0.4.5'
__author__ = "Sergey Shashkov"
__license__ = "MIT"
__copyright__ = "Copyright 2020- Sergey Shashkov"
8 changes: 7 additions & 1 deletion src/drawzero/utils/converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,13 @@ def _to_rect(rect: List, error: BadDrawParmsError) -> Optional[Tuple[int, int, i
error.errors.append(I18N.use_rect_correct)
return None
x, y, w, h = rect
return to_canvas_x(x), to_canvas_y(y), to_canvas_x(w), to_canvas_y(h)
cx = to_canvas_x(x)
cy = to_canvas_y(y)
cxw = to_canvas_x(x+w)
cyh = to_canvas_y(y+h)
cw = cxw - cx
ch = cyh - cy
return cx, cy, cw, ch


def _to_points_list(points: Union[list, tuple], error: BadDrawParmsError) -> Optional[List[Tuple[int, int]]]:
Expand Down

0 comments on commit cf9d734

Please sign in to comment.