www.gusucode.com > mbcguitools 工具箱 matlab 源码程序 > mbcguitools/@mbcwidgets/@abstractcomponent/clipRect.m

    function rect = clipRect(obj, rect, clip)
%CLIPRECT Clip a position rectangle to allowable bounds
%
%  RECT = CLIPRECT(OBJ, RECT) clips the standard Matlab position rectangle
%  RECT so that it is within the object's current position and has a height
%  and width of >=1.
%  RECT = CLIPRECT(OBJ, RECT, CLIP) uses the specified rectangle CLIP
%  instead of the object's position.

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


if nargin<3
    clip = obj.Position;
end

rect = mbcgui.util.clipRect(rect, clip);