MCPcopy Create free account
hub / github.com/NetHack/NetHack / alignTemplate

Function alignTemplate

outdated/sys/mac/mrecover.c:426–453  ·  view source on GitHub ↗

align a window-related template to the main screen */

Source from the content-addressed store, hash-verified

424
425/* align a window-related template to the main screen */
426static Handle
427alignTemplate(ResType rezType, short rezID, short vOff, short vDenom,
428 Point *pPt)
429{
430 Handle rtnHnd;
431 Rect *pRct;
432
433 vOff += GetMBarHeight();
434
435 if (!(rtnHnd = GetResource(rezType, rezID)))
436 note(nilHandleErr, 0, "\pNil Template Handle");
437
438 pRct = (Rect *) *rtnHnd;
439
440 /* don't move memory while aligning rect */
441 pRct->right -= pRct->left; /* width */
442 pRct->bottom -= pRct->top; /* height */
443 pRct->left = (qd.screenBits.bounds.right - pRct->right) / 2;
444 pRct->top = (qd.screenBits.bounds.bottom - pRct->bottom - vOff) / vDenom;
445 pRct->top += vOff;
446 pRct->right += pRct->left;
447 pRct->bottom += pRct->top;
448
449 if (pPt)
450 *pPt = *(Point *) pRct; /* top left corner */
451
452 return rtnHnd;
453}
454
455/* notification completion routine */
456pascal void

Callers 1

warmupFunction · 0.85

Calls 1

noteFunction · 0.85

Tested by

no test coverage detected