diff options
author | Jose Riha | 2024-02-02 21:34:46 +0100 |
---|---|---|
committer | Jose Riha | 2024-02-02 21:34:46 +0100 |
commit | 90ca2b2be90b150f0c0c5edf3d0ca84b4687eeb5 (patch) | |
tree | 659aae5e0f119bee65c20218d45246b060630725 /avoid_set_alpha_crash.patch | |
parent | 10d9bf2824cd995eae4f37fd5bb31346a6f5a4e1 (diff) | |
download | aur-funnyboat.tar.gz |
Adopted Debian patches and migrated to python3.
Diffstat (limited to 'avoid_set_alpha_crash.patch')
-rw-r--r-- | avoid_set_alpha_crash.patch | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/avoid_set_alpha_crash.patch b/avoid_set_alpha_crash.patch new file mode 100644 index 000000000000..a1e8a9b01ef1 --- /dev/null +++ b/avoid_set_alpha_crash.patch @@ -0,0 +1,26 @@ +From: Goneri Le Bouder <goneri@rulezlan.org> +Date: Fri, 10 May 2013 18:02:13 +0200 +Subject: avoid_set_alpha_crash + +Bug: #534596 +If val is larger than 'int', image.set_alpha throw an exception. set_alpha +argument is supposed to be < 256. +--- + particles.py | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/particles.py b/particles.py +index 22c6319..0cec708 100644 +--- a/particles.py ++++ b/particles.py +@@ -24,7 +24,9 @@ class Particle (pygame.sprite.Sprite): + pygame.draw.ellipse(self.image, self.colour, self.image.get_rect()) + + if Variables.alpha: +- self.image.set_alpha(self.life * 255 * self.opacity / self.initial_life) ++ val = self.life * 255 * self.opacity / self.initial_life ++ if val < 256: ++ self.image.set_alpha(val) + + def update(self): + self.rect.left += self.vect[0] |