pike.git/
src/
modules/
Image/
blit.c
Branch:
Tag:
Non-build tags
All tags
No tags
1997-09-18
1997-09-18 23:32:00 by Henrik Grubbström (Grubba) <grubba@grubba.org>
eca757247349657f4f911c3b5df2e29b091e0ece (
9
lines) (+
7
/-
2
)
[
Show
|
Annotate
]
Branch:
7.9
Added some more checks to img_box().
Rev: src/modules/Image/blit.c:1.14
1:
-
/* $Id: blit.c,v 1.
13
1997/09/
10
20
:
16
:
36
grubba Exp $ */
+
/* $Id: blit.c,v 1.
14
1997/09/
18
23
:
32
:
00
grubba Exp $ */
#include "global.h" /* **! module Image **! note
-
**! $Id: blit.c,v 1.
13
1997/09/
10
20
:
16
:
36
grubba Exp $<br>
+
**! $Id: blit.c,v 1.
14
1997/09/
18
23
:
32
:
00
grubba Exp $<br>
**! class image */
593:
{ if (x1>x2) x1^=x2,x2^=x1,x1^=x2; if (y1>y2) y1^=y2,y2^=y1,y1^=y2;
+
if (x2 >= THIS->xsize) x2 = THIS->xsize-1;
+
if (y2 >= THIS->ysize) y2 = THIS->ysize-1;
if (x2<0||y2<0||x1>=THIS->xsize||y1>=THIS->ysize) return;
-
+
if (x1<0) x1 = 0;
+
if (y1<0) y1 = 0;
img_box_nocheck(max(x1,0),max(y1,0),min(x2,THIS->xsize-1),min(y2,THIS->ysize-1)); }