changeset 23831:a62e03d7d53a

Check for valid zoom region in qt graphics toolkit (bug #51645). * graphics.cc (axes::properties::zoom): Test whether the zoom limits for x or y dimension are equal. If either case is true, issue a warning and don't update zoom settings.
author Daniel J Sebald <daniel.sebald@ieee.org>
date Wed, 02 Aug 2017 23:14:19 -0500
parents 595d6716e3e2
children 3544f88a2bb5
files libinterp/corefcn/graphics.cc
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/graphics.cc	Fri Aug 04 19:09:28 2017 -0400
+++ b/libinterp/corefcn/graphics.cc	Wed Aug 02 23:14:19 2017 -0500
@@ -7956,6 +7956,12 @@
                         const Matrix& xl, const Matrix& yl,
                         bool push_to_zoom_stack)
 {
+  if (xl(0) == xl(1) || yl(0) == yl(1))
+    {
+      warning ("invalid zoom region");
+      return;
+    }
+
   if (push_to_zoom_stack)
     push_zoom_stack ();