octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #49756] Crash when panning an image to top of


From: Rik
Subject: [Octave-bug-tracker] [bug #49756] Crash when panning an image to top of axes
Date: Tue, 30 Oct 2018 11:55:52 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:63.0) Gecko/20100101 Firefox/63.0

Update of bug #49756 (project octave):

                  Status:         Patch Submitted => Fixed                  
             Open/Closed:                    Open => Closed                 

    _______________________________________________________

Follow-up Comment #16:

@Pantxo: I pushed your patch here
https://hg.savannah.gnu.org/hgweb/octave/rev/221c039aa415.

I made one simplification which was to use std::swap to interchange elements
rather than doing it by hand with an intermediate variable.  See the diff
below.


diff -r 05dccc7fdb9f libinterp/corefcn/gl-render.cc
--- a/libinterp/corefcn/gl-render.cc    Sun Oct 28 21:56:40 2018 +0100
+++ b/libinterp/corefcn/gl-render.cc    Tue Oct 30 08:48:12 2018 -0700
@@ -3780,9 +3780,7 @@ namespace octave
     bool xflip = false;
     if (x(0) > x(1))
       {
-        double tmp = x(0);
-        x(0) = x(1);
-        x(1) = tmp;
+        std::swap (x(0), x(1));
         xflip = true;
       }
     else if (w > 1 && x(1) == x(0))
@@ -3791,9 +3789,7 @@ namespace octave
     bool yflip = false;
     if (y(0) > y(1))
       {
-        double tmp = y(0);
-        y(0) = y(1);
-        y(1) = tmp;
+        std::swap (y(0), y(1));
         yflip = true;
       }
     else if (h > 1 && y(1) == y(0))
@@ -3856,7 +3852,6 @@ namespace octave
         if (im_xmax > xmax)
           j1 -= (im_xmax - xmax)/nor_dx;
 
-        
         if (im_ymin < ymin)
           i0 += (ymin - im_ymin)/nor_dy + 1;
         if (im_ymax > ymax)


Thanks for the large number of graphics patches you have submitted recently. 
Marking this bug as fixed and closing report.



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?49756>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]