Skip to content

Commit f706540

Browse files
committed
Improve alignment of markers.
svn path=/trunk/matplotlib/; revision=7200
1 parent f7af8a3 commit f706540

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

src/_backend_agg.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,11 @@ RendererAgg::draw_markers(const Py::Tuple& args) {
598598

599599
if (has_clippath) {
600600
while (path_transformed.vertex(&x, &y) != agg::path_cmd_stop) {
601-
x = mpl_round(x); y = mpl_round(y);
601+
if (MPL_notisfinite64(x) || MPL_notisfinite64(y)) {
602+
continue;
603+
}
604+
605+
x = (double)(int)x; y = (double)(int)y;
602606

603607
pixfmt_amask_type pfa(pixFmt, alphaMask);
604608
amask_ren_type r(pfa);
@@ -615,7 +619,11 @@ RendererAgg::draw_markers(const Py::Tuple& args) {
615619
}
616620
} else {
617621
while (path_transformed.vertex(&x, &y) != agg::path_cmd_stop) {
618-
x = mpl_round(x); y = mpl_round(y);
622+
if (MPL_notisfinite64(x) || MPL_notisfinite64(y)) {
623+
continue;
624+
}
625+
626+
x = (double)(int)x; y = (double)(int)y;
619627

620628
if (face.first) {
621629
rendererAA.color(face.second);

0 commit comments

Comments
 (0)