Update to lasso handling. Adjust scroll amount based on difference between mouse...
[AROS.git] / rom / graphics / orrectregion.c
blob8a99f999b5381c88356983a7cf2984dfeaaf9162
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Graphics function OrRectRegion()
6 Lang: english
7 */
8 #include <exec/types.h>
9 #include <exec/memory.h>
10 #include <graphics/regions.h>
11 #include <proto/exec.h>
12 #include "intregions.h"
13 #include "graphics_intern.h"
15 /*****************************************************************************
17 NAME */
18 #include <proto/graphics.h>
20 AROS_LH2(BOOL, OrRectRegion,
22 /* SYNOPSIS */
23 AROS_LHA(struct Region *, Reg, A0),
24 AROS_LHA(struct Rectangle *, Rect, A1),
26 /* LOCATION */
27 struct GfxBase *, GfxBase, 85, Graphics)
29 /* FUNCTION
30 Add the given Rectangle to the given Region (if not
31 already there)
33 INPUTS
34 region - pointer to Region structure
35 rectangle - pointer to Rectangle structure
37 RESULT
38 TRUE if the operation was successful, else FALSE
39 (out of memory)
41 NOTES
42 All relevant data is copied, you may throw away the
43 given rectangle after calling this function
45 EXAMPLE
47 BUGS
49 SEE ALSO
50 AndRectRegion(), XorRectRegion(), ClearRectRegion()
52 INTERNALS
54 HISTORY
55 27-11-96 digulla automatically created from
56 graphics_lib.fd and clib/graphics_protos.h
57 16-01-97 mreckt initial version
59 *****************************************************************************/
61 AROS_LIBFUNC_INIT
63 struct Region Res;
64 struct RegionRectangle rr;
66 InitRegion(&Res);
68 rr.bounds = *Rect;
69 rr.Next = NULL;
70 rr.Prev = NULL;
74 _DoOperationBandBand
76 _OrBandBand,
77 MinX(Reg),
79 MinY(Reg),
81 Reg->RegionRectangle,
82 &rr,
83 &Res.RegionRectangle,
84 &Res.bounds,
85 GfxBase
89 ClearRegion(Reg);
91 *Reg = Res;
93 _TranslateRegionRectangles(Res.RegionRectangle, -MinX(&Res), -MinY(&Res));
95 return TRUE;
98 return FALSE;
100 AROS_LIBFUNC_EXIT
101 } /* OrRectRegion */