Skip to content

Commit

Permalink
fix rounding that gave us the white lines
Browse files Browse the repository at this point in the history
  • Loading branch information
HugoGranstrom authored and Vindaar committed Jan 3, 2021
1 parent 5857acb commit 45867dd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ggplotnim/ggplot_drawing.nim
Original file line number Diff line number Diff line change
Expand Up @@ -407,8 +407,8 @@ proc drawRaster(view: var Viewport, fg: FilledGeom, df: DataFrame) =
let zT = df[fg.fillCol].toTensor(float)
let zScale = fg.fillDataScale
for idx in 0 ..< df.len:
let (x, y) = (((xT[idx] - minXCol) / wv).int,
((yT[idx] - minYCol) / hv).int)
let (x, y) = (((xT[idx] - minXCol) / wv).round.int,
((yT[idx] - minYCol) / hv).round.int)
var colorIdx = (255.0 * ((zT[idx] - zScale.low) /
(zScale.high - zScale.low))).round.int
colorIdx = max(0, min(255, colorIdx))
Expand Down

0 comments on commit 45867dd

Please sign in to comment.