Skip to content

Commit

Permalink
Merge branch 'main' into use-scrap-for-paste
Browse files Browse the repository at this point in the history
  • Loading branch information
MyreMylar committed Apr 6, 2023
2 parents 996cc67 + 9e728ef commit 7991bd7
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/run_tests_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
max-parallel: 4
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
pygame-ce-version: ['2.1.4']
pygame-ce-version: ['2.1.4', '2.2.1']
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
Expand Down Expand Up @@ -49,7 +49,7 @@ jobs:
max-parallel: 4
matrix:
python-version: [ '3.11' ]
pygame-ce-version: [ '2.1.4' ]
pygame-ce-version: [ '2.1.4', '2.2.1' ]
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
Expand Down Expand Up @@ -86,7 +86,7 @@ jobs:
max-parallel: 4
matrix:
python-version: [ '3.11' ]
pygame-ce-version: [ '2.1.4' ]
pygame-ce-version: [ '2.1.4', '2.2.1' ]
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
Expand Down
2 changes: 2 additions & 0 deletions pygame_gui/core/ui_element.py
Original file line number Diff line number Diff line change
Expand Up @@ -916,6 +916,8 @@ def _set_image_clip(self, rect: Union[pygame.Rect, None]):

self._image_clip = rect
if self.image is not None:
if self.image.get_size() != self._pre_clipped_image.get_size():
self.image = pygame.Surface(self._pre_clipped_image.get_size(), flags=pygame.SRCALPHA, depth=32)
self.image.fill(pygame.Color('#00000000'))
basic_blit(self.image, self._pre_clipped_image, self._image_clip, self._image_clip)

Expand Down
3 changes: 3 additions & 0 deletions readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ sphinx:
builder: html
configuration: docs/source/conf.py

formats:
- pdf

# Optionally set the version of Python and requirements required to build your docs
python:
version: 3.7
Expand Down
6 changes: 5 additions & 1 deletion tests/test_core/test_colour_gradient.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ def test_apply_gradient_to_surface(self, _init_pygame):
gradient.apply_gradient_to_surface(test_surface)

after_application_colour = test_surface.get_at((0, 0))
assert after_application_colour == pygame.Color(0, 11, 243, 255)
if pygame.vernum.major >= 2 and pygame.vernum.minor >= 2:
# The scaling algorithm changed slightly in 2.2, this affects the gradient color
assert after_application_colour == pygame.Color(0, 5, 249, 255)
else:
assert after_application_colour == pygame.Color(0, 11, 243, 255)


if __name__ == '__main__':
Expand Down

0 comments on commit 7991bd7

Please sign in to comment.