Skip to content

Commit

Permalink
fix usage of bY -> numX, make raster example use unequal sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
Vindaar committed Jun 28, 2020
1 parent a6f7d9d commit 9bbc3b8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/ginger/backendCairo.nim
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ proc drawRaster*(img: var BImage, left, bottom, width, height: float,
for x in 0 ..< wImg:
var tX = (x.float / blockSizeX).floor.int
var tY = (y.float / blockSizeY).floor.int
data[y * wImg + x] = toDraw[tY * bY + tX]
data[y * wImg + x] = toDraw[tY * numX + tX]
pngSurface.markDirty()
# apply the new surface to the image surface
ctx.set_source(pngSurface, left, bottom)
Expand Down
4 changes: 2 additions & 2 deletions tests/tRaster.nim
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var
ys = newSeq[float]()
zs = newSeq[float]()
for x in 0 ..< 28:
for y in 0 ..< 28:
for y in 0 ..< 14:
xs.add x.float
ys.add y.float
zs.add rand(1.0)
Expand Down Expand Up @@ -41,7 +41,7 @@ view1.background()
let raster = view1.initRaster(c(0.0, 0.0),
width = quant(1.0, ukRelative),
height = quant(1.0, ukRelative),
numX = 28, numY = 28,
numX = 28, numY = 14,
drawCb = drawCb)

let grdlines = view1.initGridLines(some(xticks), some(yticks))
Expand Down

0 comments on commit 9bbc3b8

Please sign in to comment.