~ubuntu-branches/ubuntu/trusty/psychtoolbox-3/trusty-proposed

« back to all changes in this revision

Viewing changes to Psychtoolbox/PsychRects/ClipRect.m

  • Committer: Package Import Robot
  • Author(s): Yaroslav Halchenko
  • Date: 2013-11-19 23:34:50 UTC
  • mfrom: (3.1.4 experimental)
  • Revision ID: package-import@ubuntu.com-20131119233450-f7nf92vb8qavjmk8
Tags: 3.0.11.20131017.dfsg1-3
Upload to unsable since fresh glew has arrived to sid!

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
if nargin~=2
13
13
        error('Usage:  rect=ClipRect(a,b)');
14
14
end
15
 
if size(a,2)~=4 | size(b,2)~=4
 
15
if size(a,2)~=4 || size(b,2)~=4
16
16
        error('Wrong size rect argument. Usage:  rect=ClipRect(a,b)');
17
17
end
18
18
newRect=a;
20
20
newRect(RectBottom)=min(a(RectBottom),b(RectBottom));
21
21
newRect(RectLeft)=max(a(RectLeft),b(RectLeft));
22
22
newRect(RectRight)=min(a(RectRight),b(RectRight));
23
 
if RectWidth(newRect)<0 | RectHeight(newRect)<0
 
23
if RectWidth(newRect)<0 || RectHeight(newRect)<0
24
24
        newRect=[0 0 0 0];
25
25
end