* ============================================================================ *
*	PaintRect: Safe RectFill with relative width and height
*
*	void PaintRect(struct RastPort *rp,SHORT x, SHORT y, SHORT w, SHORT h);
*
*	void PaintIBox(struct RastPort *rp, struct IBox *b);
*                  a1                   a0
* ============================================================================ *

			SECTION		paintrect.asm,CODE

			xdef		_PaintRect
			xdef		_PaintIBox
			xref		_GfxBase,_LVORectFill

_PaintRect
			movem.l		d2/d3/a6,-(sp)
			move.l		16(sp),a1
			movem.w		20(sp),d0-d3
pr:
			subq.w		#1,d2
			bmi.s		9$
			subq.w		#1,d3
			bmi.s		9$
			add.w		d0,d2
			add.w		d1,d3
			move.l		_GfxBase,a6
			jsr			_LVORectFill(a6)
9$			movem.l		(sp)+,d2/d3/a6
			rts

_PaintIBox:
			movem.l		d2/d3/a6,-(sp)			; save same regs
			movem.w		(a0),d0-d3				; get regs from IBox
			bra.s		pr						; and draw like usual

			end
