diff --git a/src/plot.cpp b/src/plot.cpp index c2911f872..f7d1224f2 100644 --- a/src/plot.cpp +++ b/src/plot.cpp @@ -1197,11 +1197,15 @@ void ProjectionPlot::create_output() const int vert = omp_get_thread_num(); for (int iter = 0; iter <= pixels_[1] / n_threads; iter++) { - if (vert < pixels_[1]) { - // Save bottom line of current work chunk to compare against later - if (tid == n_threads - 1) - old_segments = this_line_segments[n_threads - 1]; + // Save bottom line of current work chunk to compare against later + // I used to have this inside the below if block, but it causes a + // spurious line to be drawn at the bottom of the image. Not sure + // why, but moving it here fixes things. + if (tid == n_threads - 1) + old_segments = this_line_segments[n_threads - 1]; + + if (vert < pixels_[1]) { for (int horiz = 0; horiz < pixels_[0]; ++horiz) { diff --git a/tests/regression_tests/plot_projections/results_true.dat b/tests/regression_tests/plot_projections/results_true.dat index 638981dc7..7f41f6a40 100644 --- a/tests/regression_tests/plot_projections/results_true.dat +++ b/tests/regression_tests/plot_projections/results_true.dat @@ -1 +1 @@ -96690b9e545d24b4e922aa30bffdd09863315e4a10301a5402c1b9f196a5ad67a1c8ac00231a1eeadb5d9c4f87cccd13bd86105765b002572acc4a33a32b070f \ No newline at end of file +186d646c4959755bf809d35c9f33a931fbd5195145131ae6764955bf276d44acf24970dfff76001106b93a7ce239d67d569440136b13073082c8ee23419d721e \ No newline at end of file diff --git a/tests/regression_tests/plot_projections/test.py b/tests/regression_tests/plot_projections/test.py index 972e0e0d7..c390a06ab 100644 --- a/tests/regression_tests/plot_projections/test.py +++ b/tests/regression_tests/plot_projections/test.py @@ -56,5 +56,5 @@ class PlotTestHarness(TestHarness): def test_plot(): - harness = PlotTestHarness(('plot_1.png', 'example1.png', 'example3.png', 'orthographic_example1.png')) + harness = PlotTestHarness(('plot_1.png', 'example1.png', 'example2.png', 'example3.png', 'orthographic_example1.png')) harness.main()