Skip to content

Commit 351d8d0

Browse files
authored
Merge pull request #311 from guzba/master
3.0.2 bugfix
2 parents f7ca3fc + 9e06278 commit 351d8d0

12 files changed

Lines changed: 16 additions & 6 deletions

pixie.nimble

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version = "3.0.1"
1+
version = "3.0.2"
22
author = "Andre von Houck and Ryan Oldenburg"
33
description = "Full-featured 2d graphics library for Nim."
44
license = "MIT"

src/pixie/images.nim

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -337,15 +337,13 @@ proc minifyBy2*(image: Image, power = 1): Image {.raises: [PixieError].} =
337337
result.setRgbaUnsafe(result.width - 1, y, rgbx)
338338

339339
if srcHeightIsOdd:
340-
let y = result.height - 1
341-
342340
for x in 0 ..< resultEvenWidth:
343341
let rgbx = mix(
344-
src.getRgbaUnsafe(x * 2 + 0, y),
345-
src.getRgbaUnsafe(x * 2 + 1, y),
342+
src.getRgbaUnsafe(x * 2 + 0, src.height - 1),
343+
src.getRgbaUnsafe(x * 2 + 1, src.height - 1),
346344
0.5
347345
) * 0.5
348-
result.setRgbaUnsafe(x, y, rgbx)
346+
result.setRgbaUnsafe(x, result.height - 1, rgbx)
349347

350348
if srcWidthIsOdd:
351349
result.setRgbaUnsafe(
2.43 KB
Loading
1.41 KB
Loading

tests/images/magnifiedBy4.png

-3 Bytes
Loading
5.79 KB
Loading
2.95 KB
Loading

tests/images/minifiedBy4.png

-1 Bytes
Loading
7.48 KB
Loading
3.56 KB
Loading

0 commit comments

Comments
 (0)