From 427cf8a52f12b3af25ccfcbb47cc188885a259c3 Mon Sep 17 00:00:00 2001 From: Kuya Takami Date: Sun, 15 Jul 2018 12:23:17 -0500 Subject: [PATCH 1/2] FIX: do not render quiver if there is no point --- chaco/quiverplot.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/chaco/quiverplot.py b/chaco/quiverplot.py index 757c22a32..0d662a480 100644 --- a/chaco/quiverplot.py +++ b/chaco/quiverplot.py @@ -76,6 +76,8 @@ def _render(self, gc, points, icon_mode=False): gc.set_line_width(self.line_width) # Draw the body of the arrow + if len(points) < 1: + return starts = points ends = points + self._cached_vector_data gc.begin_path() From 67a40a1019ecfa9667b5d2c205fe2fcae85fd0ca Mon Sep 17 00:00:00 2001 From: Kuya Takami Date: Mon, 16 Jul 2018 19:51:11 -0500 Subject: [PATCH 2/2] FIX: move point check at the beginning of method --- chaco/quiverplot.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/chaco/quiverplot.py b/chaco/quiverplot.py index 0d662a480..adf614741 100644 --- a/chaco/quiverplot.py +++ b/chaco/quiverplot.py @@ -69,6 +69,9 @@ def _gather_points_old(self): def _render(self, gc, points, icon_mode=False): + if len(points) < 1: + return + with gc: gc.clip_to_rect(self.x, self.y, self.width, self.height) @@ -76,8 +79,6 @@ def _render(self, gc, points, icon_mode=False): gc.set_line_width(self.line_width) # Draw the body of the arrow - if len(points) < 1: - return starts = points ends = points + self._cached_vector_data gc.begin_path()