MCPcopy Create free account
hub / github.com/SimHacker/micropolis / BitmapToArea

Function BitmapToArea

micropolis-activity/src/tk/tkcvbmap.c:549–572  ·  view source on GitHub ↗

ARGSUSED */

(canvasPtr, itemPtr, rectPtr)

Source from the content-addressed store, hash-verified

547 * given by rectPtr, 0 if it overlaps, and 1 if it is entirely
548 * inside the given area.
549 *
550 * Side effects:
551 * None.
552 *
553 *--------------------------------------------------------------
554 */
555
556 /* ARGSUSED */
557static int
558BitmapToArea(canvasPtr, itemPtr, rectPtr)
559 Tk_Canvas *canvasPtr; /* Canvas containing item. */
560 Tk_Item *itemPtr; /* Item to check against rectangle. */
561 double *rectPtr; /* Pointer to array of four coordinates
562 * (x1, y1, x2, y2) describing rectangular
563 * area. */
564{
565 register BitmapItem *bmapPtr = (BitmapItem *) itemPtr;
566
567 if ((rectPtr[2] <= bmapPtr->header.x1)
568 || (rectPtr[0] >= bmapPtr->header.x2)
569 || (rectPtr[3] <= bmapPtr->header.y1)
570 || (rectPtr[1] >= bmapPtr->header.y2)) {
571 return -1;
572 }
573 if ((rectPtr[0] <= bmapPtr->header.x1)
574 && (rectPtr[1] <= bmapPtr->header.y1)
575 && (rectPtr[2] >= bmapPtr->header.x2)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected