diff --git a/functions/utilities/exportStandardizedFigure/fct/updatePreview.m b/functions/utilities/exportStandardizedFigure/fct/updatePreview.m index 1c3d919c4573d410f191bc4e0c89bd6d32c2910c..8d10fd586d92e850096f82b07971580d010955c3 100644 --- a/functions/utilities/exportStandardizedFigure/fct/updatePreview.m +++ b/functions/utilities/exportStandardizedFigure/fct/updatePreview.m @@ -17,7 +17,7 @@ for i = 1:length(figHandles) width = pos(3); height = pos(4); leftOffsetNew = screen.width/5; - topOffsetNew = screen.weight/3; + topOffsetNew = screen.height/3; positionCurrentFig = [screen.width-width-leftOffsetNew, ... screen.height-height-topOffsetNew, width, height]; diff --git a/functions/utilities/exportStandardizedFigure/mainExportStandardizedFigure.m b/functions/utilities/exportStandardizedFigure/mainExportStandardizedFigure.m index 1ab33a39aad78ccb956aab90698bea905cc2fa5b..b010f7a8a3117745526739d02eb765e5f5b7ed5a 100644 --- a/functions/utilities/exportStandardizedFigure/mainExportStandardizedFigure.m +++ b/functions/utilities/exportStandardizedFigure/mainExportStandardizedFigure.m @@ -155,13 +155,16 @@ uilabel(fig, 'Text', 'Select Figure:', 'Position', [50, 500, 100, 30]); figSelectionDropDown = uidropdown(fig, ... 'Items', figNames, ... 'Position', [150, 500, 200, 30], ... - 'Tooltip', 'Select the figure you want to export', ... - 'ValueChangedFcn', @(src, event) updatePreview(fig, flagsPanel, screen, dropDown, box, inputFields)); + 'Tooltip', 'Select the figure you want to export'); %%% save dropdown into a structure dropDown.prefixIPT = prefixIPTNameDropDown; dropDown.figSelection = figSelectionDropDown; +% Set the callback *after* dropDown is complete +figSelectionDropDown.ValueChangedFcn = @(src, event) updatePreview(fig, ... + flagsPanel, screen, dropDown, box, inputFields); + % Automatically update preview if only one figure exists if isscalar(figHandles) saveTemporaryFigure(fig);