Skip to content

Reinvent the Rectangle, or The First Step Towards Rectangle Unification. #2088

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 92 commits into from
May 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
7fff854
create rect type
DigiDuncan Apr 23, 2024
e7c064c
rename the old rect to IntRect just to stop being so confusing
DigiDuncan Apr 23, 2024
7c9a71b
__init__ stubs for correct autocompletes
DigiDuncan Apr 23, 2024
6d31eb4
string methods on rect for debugging
DigiDuncan Apr 23, 2024
3a9211c
DX reference
DigiDuncan Apr 23, 2024
54fc04f
use Arcade's AsFloat
DigiDuncan Apr 24, 2024
971ab46
add at_position and clean up some functions
DigiDuncan Apr 24, 2024
b9c947b
fix a type annotation
DigiDuncan Apr 24, 2024
3d40fc5
Add Resize and Scale Methods to Rect
DragonMoffon Apr 24, 2024
248a1c7
Make Rect.scale use a float
DragonMoffon Apr 24, 2024
ed81428
remove redundant collides_with_point
DigiDuncan Apr 25, 2024
02ad3e9
add anchor point presets
DigiDuncan Apr 25, 2024
749c14d
a new kind of Rect, Viewport
DigiDuncan Apr 26, 2024
0a8f066
Improve documentation and converters
DigiDuncan Apr 26, 2024
8afdb02
begin tests
DigiDuncan Apr 26, 2024
7812f08
deprecation warnings on aliases
DigiDuncan Apr 26, 2024
f1daa26
fix warnings
DigiDuncan Apr 26, 2024
2651ec9
more tests
DigiDuncan Apr 26, 2024
0da27fd
one more test
DigiDuncan Apr 26, 2024
30195dd
get rid of this stuff
DigiDuncan Apr 26, 2024
64a2c76
We don't officially support flake8.
DigiDuncan Apr 27, 2024
d7d0f14
docstring for AnchorPoint
DigiDuncan Apr 27, 2024
c6c821d
update docstring
DigiDuncan Apr 27, 2024
5ae835c
add equivalency test
DigiDuncan Apr 27, 2024
da6dec8
no more helper classes
DigiDuncan Apr 27, 2024
2b01361
fix docstring
DigiDuncan Apr 27, 2024
bf4ba54
add Rect.kwargs
DigiDuncan Apr 28, 2024
dc60542
reference implementations for draw commands
DigiDuncan Apr 28, 2024
26e5cb6
improve reference implementations
DigiDuncan Apr 28, 2024
6aeb525
fix Viewport
DigiDuncan Apr 28, 2024
649ee9c
Update Kwargtangle to be more readable
DragonMoffon Apr 28, 2024
b408593
update gui to use rect
DragonMoffon May 9, 2024
d87314c
Adding AnchorXYWH, and removing circular import
DragonMoffon May 15, 2024
5b875de
continue bug fixing
DragonMoffon May 15, 2024
0c32a46
Rect continue
DragonMoffon May 15, 2024
c24e84a
protect against division by 0
DragonMoffon May 16, 2024
64ea867
Revert "Rect continue"
DragonMoffon May 16, 2024
26d3f64
Revert "continue bug fixing"
DragonMoffon May 16, 2024
25cfcee
Revert "update gui to use rect"
DragonMoffon May 16, 2024
e45cb37
bug fixes and adding anchors to rect
DragonMoffon May 16, 2024
f5f0ae3
list and unit test fixes
DragonMoffon May 16, 2024
00afeca
changing rect resize to use just width, height for ease of updating g…
DragonMoffon May 16, 2024
845caa2
Merge branch 'pythonarcade:development' into get_rect
DigiDuncan May 20, 2024
2c11056
move Rect draw commands to where they go
DigiDuncan May 20, 2024
6c61296
scale_axes
DigiDuncan May 20, 2024
ed33396
comments
DigiDuncan May 20, 2024
5b93466
Move AsFloat and AnchorPoint into arcade.types submodules
pushfoo May 20, 2024
37e25eb
Reduce repeated . access in Rect.to_points
pushfoo May 20, 2024
aeb7042
Add tests for current Kwargtangle behavior
pushfoo May 20, 2024
aa3b119
Split Rect instance & creation funcs into 2 files
pushfoo May 20, 2024
96b728c
Refactor Kwargtangle to be simpler and faster
pushfoo May 20, 2024
b551ffa
Update Kwartangle annotation to allow None
pushfoo May 20, 2024
8344c02
Fix typo in comments by rephrasing
pushfoo May 20, 2024
417769d
Add __repr__ subclass safety + test
pushfoo May 20, 2024
d5cae93
Make __repr__ return a runnable value
pushfoo May 20, 2024
2240646
Replace commented-out __repr__ with comment on __str__
pushfoo May 20, 2024
94f84f5
Replace fixtures with simpler function
pushfoo May 20, 2024
75b012a
Merge pull request #5 from pushfoo/touchup-DigiDuncan-get_rect
DigiDuncan May 20, 2024
ad948e6
kwargtangle -> from_kwargs
DigiDuncan May 20, 2024
700a881
rip kwargtangle
DigiDuncan May 20, 2024
f4c672a
rename to XYWHAnchored
DigiDuncan May 20, 2024
3648b46
better naming of draw commands
DigiDuncan May 21, 2024
4e77732
docstrings
DigiDuncan May 21, 2024
45869b2
opinionated choices about draw commands
DigiDuncan May 21, 2024
b659866
fix from_kwargs
DigiDuncan May 21, 2024
2a50497
point_on_bounds
DigiDuncan May 21, 2024
78bbcd6
point_in_bounds optimization
DigiDuncan May 21, 2024
30d93e0
improve point_on_bounds
DragonMoffon May 21, 2024
322a152
fixed unit tests
DragonMoffon May 21, 2024
45a0e14
Hook Rect PR into our build setup
pushfoo May 22, 2024
57f4dc7
docstrings
DigiDuncan May 22, 2024
bbfe4bb
Get doc to build by fixing imports and quick index
pushfoo May 22, 2024
033b5e5
Add newline to end of a file
pushfoo May 22, 2024
8094195
Merge pull request #6 from pushfoo/get_rect
DigiDuncan May 22, 2024
e82e31f
Add __future__ to conftest to allow tuple subscript imports
pushfoo May 22, 2024
08f4abe
Add reduced version of glossary page
pushfoo May 22, 2024
deacf5b
Document Rect attributes
pushfoo May 22, 2024
77085d3
Revert "Add reduced version of glossary page"
pushfoo May 22, 2024
4a7b371
Example ruff fix + local access shorthand
pushfoo May 22, 2024
f206f28
Merge pull request #7 from pushfoo/more-rect-touchups
DigiDuncan May 22, 2024
2444477
-.- 3.8 compatible typing
DragonMoffon May 22, 2024
c9ab4fb
Merge branch 'get_rect' of https://github.com/DigiDuncan/arcade into …
DragonMoffon May 22, 2024
ddf91d1
Digi forgor to fix the unit tests
DragonMoffon May 22, 2024
0e1c584
linting fix
DragonMoffon May 22, 2024
0cd7dcb
-.- I hate alligators
DragonMoffon May 22, 2024
4340cb3
remove XYWHAnchored in favor of optional anchor keyword
DigiDuncan May 22, 2024
dc21523
add .aspect_ratio
DigiDuncan May 24, 2024
cdd39cc
remove AnchoredXYWH from docstring
DigiDuncan May 24, 2024
1182552
better explanation of tuple props
DigiDuncan May 24, 2024
1f34024
fix XYRR math and improve test
DigiDuncan May 24, 2024
1804b5f
less and more opinionated
DigiDuncan May 25, 2024
9a6e9f6
fixing atlas rendering
DragonMoffon May 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,5 @@ doc/api_docs/api/*.rst

# Pyenv local
.python-version

.flake8
30 changes: 16 additions & 14 deletions arcade/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,26 +118,25 @@ def configure_logging(level: Optional[int] = None):
from .draw_commands import draw_line
from .draw_commands import draw_line_strip
from .draw_commands import draw_lines
from .draw_commands import draw_lrtb_rectangle_filled
from .draw_commands import draw_lrbt_rectangle_filled
from .draw_commands import draw_lrtb_rectangle_outline
from .draw_commands import draw_lrbt_rectangle_outline
from .draw_commands import draw_lbwh_rectangle_textured
from .draw_commands import draw_lrwh_rectangle_textured
from .draw_commands import draw_parabola_filled
from .draw_commands import draw_parabola_outline
from .draw_commands import draw_point
from .draw_commands import draw_points
from .draw_commands import draw_polygon_filled
from .draw_commands import draw_polygon_outline
from .draw_commands import draw_rectangle_filled
from .draw_commands import draw_rectangle_outline
from .draw_commands import draw_rect_filled
from .draw_commands import draw_rect_outline
from .draw_commands import draw_scaled_texture_rectangle
from .draw_commands import draw_texture_rectangle
from .draw_commands import draw_triangle_filled
from .draw_commands import draw_triangle_outline
from .draw_commands import draw_xywh_rectangle_filled
from .draw_commands import draw_xywh_rectangle_outline
from .draw_commands import draw_lbwh_rectangle_filled
from .draw_commands import draw_lbwh_rectangle_outline
from .draw_commands import draw_rect_filled_kwargs
from .draw_commands import draw_rect_outline_kwargs
from .draw_commands import get_image
from .draw_commands import get_pixel

Expand Down Expand Up @@ -228,6 +227,7 @@ def configure_logging(level: Optional[int] = None):
from arcade import shape_list as shape_list
from arcade import hitbox as hitbox
from arcade import experimental as experimental
from arcade.types import rect

from .text import (
draw_text,
Expand Down Expand Up @@ -296,26 +296,27 @@ def configure_logging(level: Optional[int] = None):
'draw_line_strip',
'draw_lines',
'draw_lbwh_rectangle_textured',
'draw_lrtb_rectangle_filled',
'draw_lrbt_rectangle_filled',
'draw_lrtb_rectangle_outline',
'draw_lrbt_rectangle_filled',
'draw_lrbt_rectangle_outline',
'draw_lrbt_rectangle_outline',
'draw_lrwh_rectangle_textured',
'draw_parabola_filled',
'draw_parabola_outline',
'draw_point',
'draw_points',
'draw_polygon_filled',
'draw_polygon_outline',
'draw_rectangle_filled',
'draw_rectangle_outline',
'draw_rect_filled',
'draw_rect_outline',
'draw_scaled_texture_rectangle',
'draw_text',
'draw_texture_rectangle',
'draw_triangle_filled',
'draw_triangle_outline',
'draw_xywh_rectangle_filled',
'draw_xywh_rectangle_outline',
'draw_lbwh_rectangle_filled',
'draw_lbwh_rectangle_outline',
'draw_rect_outline_kwargs',
'draw_rect_filled_kwargs',
'enable_timings',
'exit',
'finish_render',
Expand Down Expand Up @@ -368,6 +369,7 @@ def configure_logging(level: Optional[int] = None):
'get_default_image',
'hitbox',
'experimental',
'rect',
'color',
'csscolor',
'key',
Expand Down
Loading
Loading