fix rgbaSmooht
This commit is contained in:
parent
6e400197df
commit
eede47843d
1 changed files with 5 additions and 5 deletions
|
@ -544,12 +544,12 @@ proc getRgbaSmooth*(
|
||||||
## Gets a interpolated color with float point coordinates.
|
## Gets a interpolated color with float point coordinates.
|
||||||
## Pixes outside the image are transparent.
|
## Pixes outside the image are transparent.
|
||||||
let
|
let
|
||||||
x0 = x.int
|
x0 = x.floor.int
|
||||||
y0 = y.int
|
y0 = y.floor.int
|
||||||
x1 = x0 + 1
|
x1 = x0 + 1
|
||||||
y1 = y0 + 1
|
y1 = y0 + 1
|
||||||
xFractional = x.fractional
|
xFractional = x - x.floor
|
||||||
yFractional = y.fractional
|
yFractional = y - y.floor
|
||||||
|
|
||||||
var x0y0, x1y0, x0y1, x1y1: ColorRGBX
|
var x0y0, x1y0, x0y1, x1y1: ColorRGBX
|
||||||
if wrapped:
|
if wrapped:
|
||||||
|
@ -716,7 +716,7 @@ proc drawUber(
|
||||||
|
|
||||||
if smooth:
|
if smooth:
|
||||||
var srcPos = p + dx * xMin.float32 + dy * y.float32
|
var srcPos = p + dx * xMin.float32 + dy * y.float32
|
||||||
srcPos = vec2(max(0, srcPos.x), max(0, srcPos.y))
|
srcPos = vec2(srcPos.x, srcPos.y)
|
||||||
|
|
||||||
for x in xMin ..< xMax:
|
for x in xMin ..< xMax:
|
||||||
let
|
let
|
||||||
|
|
Loading…
Reference in a new issue