2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
5 Desc: Graphics function ScrollRegion()
8 #include "graphics_intern.h"
9 #include <graphics/regions.h>
10 #include "intregions.h"
11 #include "gfxfuncsupport.h"
13 /*****************************************************************************
16 #include <proto/graphics.h>
18 AROS_LH4(BOOL
, ScrollRegion
,
21 AROS_LHA(struct Region
*, region
, A0
),
22 AROS_LHA(struct Rectangle
*, rect
, A1
),
23 AROS_LHA(WORD
, dx
, D0
),
24 AROS_LHA(WORD
, dy
, D1
),
27 struct GfxBase
*, GfxBase
, 191, Graphics
)
30 Scroll the rectangles in the region by the amount of pixels specified, within the
34 region - pointer to a region structure
35 rect - pointer to the rectangle within which the scrolling has to happen.
36 If NULL, the region's bounds are used instead.
37 dx, dy - the amount of pixels by which to scroll the region. Negative values mean
38 respectively left and up, positive values mean right and down.
40 TRUE if the operation succeeded, FALSE otherwise.
43 This function doesn't exist in AmigaOS
56 *****************************************************************************/
64 TranslateRect(Bounds(region
), dx
, dy
);
70 struct Region
*cutRegion
;
72 cutRegion
= AndRectRegionND(region
, rect
);
75 struct Region
*newRegion
;
77 TranslateRect(Bounds(cutRegion
), dx
, dy
);
79 AndRectRegion(cutRegion
, rect
);
81 newRegion
= ClearRectRegionND(region
, rect
);
84 if (OrRegionRegion(cutRegion
, newRegion
))
86 _SwapRegions(region
, newRegion
);
91 DisposeRegion(newRegion
);
94 DisposeRegion(cutRegion
);