idiomatic thresholding

Co-authored-by: Patrick Shriwise <pshriwise@gmail.com>
This commit is contained in:
Gavin Ridley 2023-04-05 11:05:30 -04:00 committed by GitHub
parent 62859d39ba
commit 5c4144d520
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1436,9 +1436,9 @@ void ProjectionPlot::create_output() const
if (i * i + j * j < wireframe_thickness_ * wireframe_thickness_) {
// Check if wireframe pixel is out of bounds
if (horiz + i >= 0 && horiz + i < pixels_[0] && vert + j >= 0 &&
vert + j < pixels_[1])
data(horiz + i, vert + j) = wireframe_color_;
int w_i = std::max(std::min(horiz + i, pixels_[0]), 0);
int w_j = std::max(std::min(vert + j, pixels_[1]), 0);
data(i, j) = wireframe_color_;
}
}
}