restrict_value
x = restrict_value(x, 0, fWidth - 1);
x = restrict_value(x, 0, fWidth - 1);
x = restrict_value(x, 0, fWidth - 1);
y = restrict_value(y, fScrollTop, fScrollBottom);
y = restrict_value(y, 0, fHeight - 1);
x = restrict_value(x, 0, fWidth - 1);
x = restrict_value(x, 0, fWidth - 1);
fScrollTop = restrict_value(top, 0, fHeight - 1);
fScrollBottom = restrict_value(bottom, fScrollTop, fHeight - 1);
start = restrict_value(start, minPos, maxPos);
end = restrict_value(end, minPos, maxPos);