2 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
5 Desc: Graphics function ScrollRegion()
9 #include "graphics_intern.h"
10 #include <graphics/regions.h>
11 #include "intregions.h"
12 #include "gfxfuncsupport.h"
14 /*****************************************************************************
17 #include <proto/graphics.h>
19 AROS_LH4(BOOL
, ScrollRegion
,
22 AROS_LHA(struct Region
*, region
, A0
),
23 AROS_LHA(struct Rectangle
*, rect
, A1
),
24 AROS_LHA(WORD
, dx
, D0
),
25 AROS_LHA(WORD
, dy
, D1
),
28 struct GfxBase
*, GfxBase
, 185, Graphics
)
31 Scroll the rectangles in the region by the amount of pixels specified, within the
35 region - pointer to a region structure
36 rect - pointer to the rectangle within which the scrolling has to happen.
37 If NULL, the region's bounds are used instead.
38 dx, dy - the amount of pixels by which to scroll the region. Negative values mean
39 respectively left and up, positive values mean right and down.
41 TRUE if the operation succeeded, FALSE otherwise.
44 This function doesn't exist in AmigaOS
57 *****************************************************************************/
65 TranslateRect(Bounds(region
), dx
, dy
);
71 struct Region
*cutRegion
;
73 cutRegion
= AndRectRegionND(region
, rect
);
76 struct Region
*newRegion
;
78 TranslateRect(Bounds(cutRegion
), dx
, dy
);
80 AndRectRegion(cutRegion
, rect
);
82 newRegion
= ClearRectRegionND(region
, rect
);
85 if (OrRegionRegion(cutRegion
, newRegion
))
87 _SwapRegions(region
, newRegion
);
92 DisposeRegion(newRegion
);
95 DisposeRegion(cutRegion
);