Open hemaolong opened 1 year ago
I face a similar issue.
flamegraph points to:
https://github.com/plotters-rs/plotters/blob/master/plotters-backend/src/rasterizer/polygon.rs
I have identified that the loop ->
for sweep_line in low..=high { } uses -> Low: 4 High: 2147483647 when the number of points per above example is 2000 and -> Low: 4 High636 when the number of points is 200
High appears to be the i32::MAX
Which I believe is converted from f64 to i32 here: https://github.com/plotters-rs/plotters/blob/master/plotters-backend/src/rasterizer/line.rs#L31
@hemaolong If i change stroke width to 1 in your example it works as it avoids this logic.
The code below will trigger the bug,it seems float overflow.
fn test_plot_bug() -> Result<()> { use plotters::prelude::*;
}