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