function dummy = updategain(Editor)
%UPDATEGAIN  Lightweight plot update when modifying the loop gain.

%   Author(s): P. Gahinet
%   Copyright 1986-2000 The MathWorks, Inc. 
%   $Revision: 1.9 $  $Date: 2000/08/17 22:16:19 $

% RE: Assumes gain does not change sign

% REVISIT
dummy = [];

if strcmp(Editor.EditMode,'off') | strcmp(Editor.Visible,'off')
    % Editor is inactive
    return
end

% Compute new mag data
GainMag = abs(getgain(Editor.LoopData));
MagData = unitconv(GainMag*Editor.Magnitude,'abs',Editor.MagnitudeUnits);

% Update mag plot vertical position
HG = Editor.HG;
set(HG.BodePlot(1),'Ydata',MagData); 

%---Update pole/zero positions in mag plot
interpy(Editor,MagData);

% Update axis limits (also updates margin display)
updatelims(Editor);
