comments
This commit is contained in:
parent
5508c3fccd
commit
af130f76b9
1 changed files with 2 additions and 9 deletions
|
@ -402,9 +402,6 @@ proc drawCorrect*(a, b: Image, mat: Mat3, blendMode: BlendMode) =
|
||||||
minFilterBy2 /= 2
|
minFilterBy2 /= 2
|
||||||
matInv = matInv * scale(vec2(0.5, 0.5))
|
matInv = matInv * scale(vec2(0.5, 0.5))
|
||||||
|
|
||||||
let smooth = not(dx.length == 1.0 and dy.length == 1.0 and
|
|
||||||
mat[2, 0].fractional == 0.0 and mat[2, 1].fractional == 0.0)
|
|
||||||
|
|
||||||
let mixer = blendMode.mixer()
|
let mixer = blendMode.mixer()
|
||||||
for y in 0 ..< a.height:
|
for y in 0 ..< a.height:
|
||||||
for x in 0 ..< a.width:
|
for x in 0 ..< a.width:
|
||||||
|
@ -413,11 +410,7 @@ proc drawCorrect*(a, b: Image, mat: Mat3, blendMode: BlendMode) =
|
||||||
xFloat = srcPos.x - h
|
xFloat = srcPos.x - h
|
||||||
yFloat = srcPos.y - h
|
yFloat = srcPos.y - h
|
||||||
rgba = a.getRgbaUnsafe(x, y)
|
rgba = a.getRgbaUnsafe(x, y)
|
||||||
rgba2 =
|
rgba2 = b.getRgbaSmooth(xFloat, yFloat)
|
||||||
if smooth:
|
|
||||||
b.getRgbaSmooth(xFloat, yFloat)
|
|
||||||
else:
|
|
||||||
b[xFloat.round.int, yFloat.round.int]
|
|
||||||
a.setRgbaUnsafe(x, y, mixer(rgba, rgba2))
|
a.setRgbaUnsafe(x, y, mixer(rgba, rgba2))
|
||||||
|
|
||||||
proc drawUber(
|
proc drawUber(
|
||||||
|
@ -460,7 +453,7 @@ proc drawUber(
|
||||||
if smooth:
|
if smooth:
|
||||||
b.getRgbaSmooth(xFloat, yFloat)
|
b.getRgbaSmooth(xFloat, yFloat)
|
||||||
else:
|
else:
|
||||||
b.getRgbaUnsafe(xFloat.int, yFloat.int)
|
b.getRgbaUnsafe(xFloat.round.int, yFloat.round.int)
|
||||||
a.setRgbaUnsafe(x, y, mixer(rgba, rgba2))
|
a.setRgbaUnsafe(x, y, mixer(rgba, rgba2))
|
||||||
|
|
||||||
if blendMode == bmIntersectMask:
|
if blendMode == bmIntersectMask:
|
||||||
|
|
Loading…
Reference in a new issue