ARGSUSED */
(canvasPtr, itemPtr, coordPtr)
| 489 | * distance from the point to the bitmap. |
| 490 | * |
| 491 | * Side effects: |
| 492 | * None. |
| 493 | * |
| 494 | *-------------------------------------------------------------- |
| 495 | */ |
| 496 | |
| 497 | /* ARGSUSED */ |
| 498 | static double |
| 499 | BitmapToPoint(canvasPtr, itemPtr, coordPtr) |
| 500 | Tk_Canvas *canvasPtr; /* Canvas containing item. */ |
| 501 | Tk_Item *itemPtr; /* Item to check against point. */ |
| 502 | double *coordPtr; /* Pointer to x and y coordinates. */ |
| 503 | { |
| 504 | register BitmapItem *bmapPtr = (BitmapItem *) itemPtr; |
| 505 | double x1, x2, y1, y2, xDiff, yDiff; |
| 506 | |
| 507 | x1 = bmapPtr->header.x1; |
| 508 | y1 = bmapPtr->header.y1; |
| 509 | x2 = bmapPtr->header.x2; |
| 510 | y2 = bmapPtr->header.y2; |
| 511 | |
| 512 | /* |
| 513 | * Point is outside rectangle. |
| 514 | */ |
| 515 | |
| 516 | if (coordPtr[0] < x1) { |
| 517 | xDiff = x1 - coordPtr[0]; |
| 518 | } else if (coordPtr[0] > x2) { |
| 519 | xDiff = coordPtr[0] - x2; |
| 520 | } else { |
| 521 | xDiff = 0; |
| 522 | } |
| 523 | |
| 524 | if (coordPtr[1] < y1) { |
| 525 | yDiff = y1 - coordPtr[1]; |
| 526 | } else if (coordPtr[1] > y2) { |
| 527 | yDiff = coordPtr[1] - y2; |
| 528 | } else { |
| 529 | yDiff = 0; |
nothing calls this directly
no outgoing calls
no test coverage detected