Fix isTransparent and add test.
This commit is contained in:
parent
d804f574c1
commit
b84746f6f2
2 changed files with 5 additions and 2 deletions
|
@ -130,8 +130,6 @@ proc isOneColor(image: Image, color: ColorRGBX): bool =
|
||||||
## Checks if the entire image is color.
|
## Checks if the entire image is color.
|
||||||
result = true
|
result = true
|
||||||
|
|
||||||
let color = image.getRgbaUnsafe(0, 0)
|
|
||||||
|
|
||||||
var i: int
|
var i: int
|
||||||
when defined(amd64) and not defined(pixieNoSimd):
|
when defined(amd64) and not defined(pixieNoSimd):
|
||||||
let colorVec = mm_set1_epi32(cast[int32](color))
|
let colorVec = mm_set1_epi32(cast[int32](color))
|
||||||
|
|
|
@ -197,3 +197,8 @@ block:
|
||||||
let image = newImage(100, 100)
|
let image = newImage(100, 100)
|
||||||
image[99, 99] = rgba(255, 255, 255, 255)
|
image[99, 99] = rgba(255, 255, 255, 255)
|
||||||
doAssert not image.isTransparent()
|
doAssert not image.isTransparent()
|
||||||
|
|
||||||
|
block:
|
||||||
|
let image = newImage(100, 100)
|
||||||
|
image.fill(rgba(255, 255, 255, 255))
|
||||||
|
doAssert not image.isTransparent()
|
||||||
|
|
Loading…
Reference in a new issue