www.gusucode.com > mbcguitools 工具箱 matlab 源码程序 > mbcguitools/@xregGui/@axisslider/doPosition.m

    function doPosition( h , newpos)
%DOPOSITION Redraw axisslider control
%
%  H.DOPOSITION;
%  H.DOPOSITION(NEWPOS);
%

%  Copyright 2000-2013 The MathWorks, Inc. and Ford Global Technologies, Inc.

if nargin==1
    newpos = h.Position;
end
newpos(3:4) = max(newpos(3:4), [1 1]);

if strcmp(h.Orientation, 'vertical')
    axpos = [max(newpos(1), newpos(1)+newpos(3)-6 ) newpos(2)  1  newpos(4)];
else
    axpos = [newpos(1)  max(newpos(2), newpos(2)+newpos(4)-6)  newpos(3) 1];
end

set(h.Axes, 'Position', axpos);