home *** CD-ROM | disk | FTP | other *** search
- * ============================================================================ *
- * SetupImageIBox: figures the real hit box for a gadget
- *
- * SetupImageIBox(box,image,imp_draw)
- * a0 a1 a2
- *
- * This function computes the hit box for an image class, taking the IMP_DRAWFRAME
- * message into account for sieable boxes.
- * ============================================================================ *
-
- include "exec/types.i"
- include "intuition/intuition.i"
- include "intuition/imageclass.i"
- include "macros.i"
-
- SECTION gadgetbox.asm,CODE
-
- xdef _SetupImageIBox,SetupImageIBox
-
- qregs reg d2-d7/a6
-
- _SetupImageIBox:
- move.l a2,-(sp)
- movem.l 8(sp),a0-a2
- bsr SetupImageIBox
- move.l (sp)+,a2
- rts
-
- SetupImageIBox:
- move.l ig_LeftEdge(a1),ibox_Left(a0)
- move.l ig_Width(a1),ibox_Width(a0)
-
- move.w impd_OffsetX(a2),d1
- add.w d1,ibox_Left(a0)
- move.w impd_OffsetY(a2),d1
- add.w d1,ibox_Top(a0)
-
- cmp.l #IM_DRAWFRAME,(a2)
- blt.s 1$
- move.w impd_DimensionsWidth(a2),ibox_Width(a0)
- move.w impd_DimensionsHeight(a2),ibox_Height(a0)
-
- 1$ rts
-
- end
-
- /* original C source */
-
- getbox(struct IBox *box, struct Image *img, struct impDraw *msg)
- { *box = *IM_BOX( IM(img) ); /* get Image.Left/Top/Width/Height */
-
- box->Left += msg->imp_Offset.X;
- box->Top += msg->imp_Offset.Y;
-
- if ( msg->MethodID == IM_DRAWFRAME )
- { box->Width = msg->imp_Dimensions.Width;
- box->Height = msg->imp_Dimensions.Height;
- }
- }
-