diff --git a/src/pixie/masks.nim b/src/pixie/masks.nim index 6856ba6..365bc2c 100644 --- a/src/pixie/masks.nim +++ b/src/pixie/masks.nim @@ -152,18 +152,17 @@ proc magnifyBy2*(mask: Mask, power = 1): Mask {.raises: [PixieError].} = x += 16 for x in x ..< mask.width: let - value = mask.unsafe[x, y div scale] - scaledX = x * scale - idx = result.dataIndex(scaledX, y) + value = mask.unsafe[x, y] + resultIdx = result.dataIndex(x * scale, y * scale) for i in 0 ..< scale: - result.data[idx + i] = value + result.data[resultIdx + i] = value # Copy that row of values into (scale - 1) more rows let rowStart = result.dataIndex(0, y * scale) for i in 1 ..< scale: copyMem( result.data[rowStart + result.width * i].addr, result.data[rowStart].addr, - result.width * 4 + result.width ) proc applyOpacity*(target: Mask, opacity: float32) {.hasSimd, raises: [].} =