From 0f20c6f7dc6a3b4889bc36f3db8e6f35ae50b01d Mon Sep 17 00:00:00 2001 From: ThFriedrich <47680554+ThFriedrich@users.noreply.github.com> Date: Fri, 11 Oct 2019 15:39:12 +0200 Subject: [PATCH] Fixed compatibility issues Fixed GUI interface compatibility issue causing StatSTEM GUI to crash under MATLAB 2019a when clicking button while in zoom mode. --- GUI/generalFunc/turnOffFigureSelection.m | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/GUI/generalFunc/turnOffFigureSelection.m b/GUI/generalFunc/turnOffFigureSelection.m index 58bfc07..563bbd4 100644 --- a/GUI/generalFunc/turnOffFigureSelection.m +++ b/GUI/generalFunc/turnOffFigureSelection.m @@ -16,6 +16,10 @@ % Contact: sandra.vanaert@uantwerpen.be %-------------------------------------------------------------------------- +% Determine Matlab version for compatibility +v = version('-release'); +v = str2double(v(1:4)); + % First turn off zoom, pan and datacursor h_pan = pan(h.fig); h_zoom = [h.zoom.in;h.zoom.out]; @@ -23,4 +27,10 @@ h_cursor.removeAllDataCursors(); set(h_pan,'Enable','off') set(h_cursor,'Enable','off') -zoomAxinFig(h,'off') \ No newline at end of file + +if v < 2019 + zoomAxinFig(h,'off') +else + h_z = zoom(h.fig); + h_z.Enable = 'off'; +end