Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix rounding that gave us the white lines #108

Merged
merged 1 commit into from
Jan 3, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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