From b86de209293f346e97349501801b905ebc58acde Mon Sep 17 00:00:00 2001
From: Yves Gouriou <yves.gouriou@ird.fr>
Date: Mon, 26 Jan 2009 16:03:36 +0000
Subject: [PATCH] =?UTF-8?q?Bugs=20li=C3=A9s=20=C3=A0=20l'affichage=20de=20?=
 =?UTF-8?q?la=20carte=20dans=20une=20fen=C3=AAtre=20s=C3=A9par=C3=A9e,=20r?=
 =?UTF-8?q?=C3=A9solus.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 tsg_util/quitProgram.m |  2 +-
 tsgqc.m                | 23 ++++++++++++++++-------
 2 files changed, 17 insertions(+), 8 deletions(-)

diff --git a/tsg_util/quitProgram.m b/tsg_util/quitProgram.m
index cc754a8..b74d33d 100644
--- a/tsg_util/quitProgram.m
+++ b/tsg_util/quitProgram.m
@@ -13,8 +13,8 @@ function quitProgram(hMainFig, hMapPanel, DEFAULT_PATH_FILE)
 
 % close the main windows
 % ----------------------
-delete(hMainFig);
 delete(hMapPanel);
+delete(hMainFig);
 
 % reset userdata property of root Matalab object (0) for next use
 % ---------------------------------------------------------------
diff --git a/tsgqc.m b/tsgqc.m
index 60122ee..090ab2d 100644
--- a/tsgqc.m
+++ b/tsgqc.m
@@ -629,7 +629,7 @@ hPlotAxes(3) = axes('Parent', hPlotsPanel, 'Visible', 'off',...
 % ---------------------------------
 hMapPanel = figure(...
    'BackingStore','off',...
-  'Name', 'TSG MAP FIGURE', ...
+  'Name', 'TSG SHIP TRACK', ...
   'NumberTitle', 'off', ...
   'Resize', 'on', ...
   'Menubar','none', ...
@@ -1905,8 +1905,10 @@ end
     
     % Re-draw the map once the zoom/pan is off 
     % ----------------------------------------
-    erase_Line( hPlotAxes, 4 );
-    plot_map( hMainFig, hPlotAxes);
+    if strcmp( get(hMapPanel,'visible'), 'on') == 1
+      erase_Line( hPlotAxes, 4 );
+      plot_map( hMainFig, hPlotAxes);
+    end
 
   end
 
@@ -2220,6 +2222,7 @@ end
   % Callback function ... to be completed
   % ---------------------------------------------------------------
   function postQcPanCallback(obj, evd)
+         
     % Set the right limit and interval to the 3 axes
     % ----------------------------------------------
     for iaxe = 1:3
@@ -2229,9 +2232,15 @@ end
 
     % Re-draw the map once the pan is off -  only valide in QC mode
     % -------------------------------------------------------------
-    erase_Line( hPlotAxes, 4 );
-    plot_map( hMainFig, hPlotAxes);
+    if strcmp( get(hMapPanel, 'visible'), 'on') == 1
+      erase_Line( hPlotAxes, 4 );
+      plot_map( hMainFig, hPlotAxes);
+    end
 
+    % restacks the figure to the top of the screen
+    % --------------------------------------------
+    figure( hMainFig);
+    
     set(hQCToggletool, 'state', 'on' );
 
   end
@@ -2282,7 +2291,7 @@ end
           set(hPan,'ActionPostCallback', @postQcPanCallback);
           set(hPan,'Enable','on');
         else
-          pan off
+            pan(hMainFig, 'off');
         end
       end
       
@@ -3179,7 +3188,7 @@ end
     % Make the earth map invisible
     % ----------------------------
     set(hMapPanel, 'Visible', 'off' ); 
-    set( hMapToggletool,       'state',  'off' );
+    set(hMapToggletool, 'state',  'off' );
     
   end
 
-- 
GitLab