This commit is contained in:
Ryan Oldenburg 2021-12-13 00:31:35 -06:00
parent be598a108b
commit 1352ff73b0
2 changed files with 6 additions and 5 deletions

View file

@ -53,7 +53,7 @@ block:
ctx.mask(source, 0, 0)
tmp.flush()
echo tmp.writeToPng("tmp_masked.png")
# echo tmp.writeToPng("tmp_masked.png")
block:
let
@ -65,7 +65,7 @@ block:
tmp.draw(backdrop)
tmp.draw(source, blendMode = bmMask)
tmp.writeFile("tmp_masked2.png")
# tmp.writeFile("tmp_masked2.png")
block:
let

View file

@ -913,7 +913,8 @@ proc drawUber(
clamp(srcPos.y, 0, b.height.float32)
)
if blendMode == bmOverwrite:
case blendMode:
of bmOverwrite:
for x in x ..< xMax:
let samplePos = ivec2((srcPos.x - h).int32, (srcPos.y - h).int32)
when type(a) is Image:
@ -929,7 +930,7 @@ proc drawUber(
let source = b.unsafe[samplePos.x, samplePos.y]
a.unsafe[x, y] = source
srcPos += dx
elif blendMode == bmNormal:
of bmNormal:
for x in x ..< xMax:
let samplePos = ivec2((srcPos.x - h).int32, (srcPos.y - h).int32)
when type(a) is Image:
@ -955,7 +956,7 @@ proc drawUber(
let backdrop = a.unsafe[x, y]
a.unsafe[x, y] = blendAlpha(backdrop, source)
srcPos += dx
elif blendMode == bmMask:
of bmMask:
for x in x ..< xMax:
let samplePos = ivec2((srcPos.x - h).int32, (srcPos.y - h).int32)
when type(a) is Image: