f
This commit is contained in:
parent
741234786c
commit
d80df8f958
1 changed files with 6 additions and 6 deletions
|
@ -169,13 +169,13 @@ proc toPremultipliedAlpha*(data: var seq[ColorRGBA | ColorRGBX]) {.raises: [].}
|
||||||
i += 4
|
i += 4
|
||||||
|
|
||||||
# Convert whatever is left
|
# Convert whatever is left
|
||||||
for j in i ..< data.len:
|
for i in i ..< data.len:
|
||||||
var c = data[j]
|
var c = data[i]
|
||||||
if c.a != 255:
|
if c.a != 255:
|
||||||
c.r = ((c.r.uint32 * c.a.uint32) div 255).uint8
|
c.r = ((c.r.uint32 * c.a) div 255).uint8
|
||||||
c.g = ((c.g.uint32 * c.a.uint32) div 255).uint8
|
c.g = ((c.g.uint32 * c.a) div 255).uint8
|
||||||
c.b = ((c.b.uint32 * c.a.uint32) div 255).uint8
|
c.b = ((c.b.uint32 * c.a) div 255).uint8
|
||||||
data[j] = c
|
data[i] = c
|
||||||
|
|
||||||
proc isOpaque*(data: var seq[ColorRGBX], start, len: int): bool =
|
proc isOpaque*(data: var seq[ColorRGBX], start, len: int): bool =
|
||||||
result = true
|
result = true
|
||||||
|
|
Loading…
Reference in a new issue