#include "StdAfx.h" #include "UPoint.h" /*static*/ void UPoint::MappingInRect(Point& ioPt, const RECT& inRect) { ioPt.h = (ioPt.h < inRect.right) ? ioPt.h : inRect.right; ioPt.h = (ioPt.h >= inRect.left) ? ioPt.h : inRect.left; ioPt.v = (ioPt.v < inRect.bottom) ? ioPt.v : inRect.bottom; ioPt.v = (ioPt.v >= inRect.top) ? ioPt.v : inRect.top; } /*static*/ void UPoint::MappingInRect(POINT& ioPt, const RECT& inRect) { ioPt.x = (ioPt.x < inRect.right) ? ioPt.x : inRect.right; ioPt.x = (ioPt.x >= inRect.left) ? ioPt.x : inRect.left; ioPt.y = (ioPt.y < inRect.bottom) ? ioPt.y : inRect.bottom; ioPt.y = (ioPt.y >= inRect.top) ? ioPt.y : inRect.top; }