summaryrefslogtreecommitdiff
path: root/src/T2DLL/UPoint.cpp
blob: 0f4d3d32d1a0c564ba10bae398046294b041ee98 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#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;
}