本文整理汇总了C++中Boundary::growWidth方法的典型用法代码示例。如果您正苦于以下问题:C++ Boundary::growWidth方法的具体用法?C++ Boundary::growWidth怎么用?C++ Boundary::growWidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Boundary
的用法示例。
在下文中一共展示了Boundary::growWidth方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: y
Boundary
GUIPointOfInterest::getCenteringBoundary() const {
Boundary b;
b.add(x(), y());
b.growWidth(myHalfImgWidth);
b.growHeight(myHalfImgHeight);
return b;
}
示例2:
Boundary
GUIPerspectiveChanger::patchedViewPort() {
// avoid division by zero
if (myCallback.getHeight() == 0 ||
myCallback.getWidth() == 0 ||
myViewPort.getHeight() == 0 ||
myViewPort.getWidth() == 0) {
return myViewPort;
}
Boundary result = myViewPort;
SUMOReal canvasRatio = (SUMOReal)myCallback.getWidth() / myCallback.getHeight();
SUMOReal ratio = result.getWidth() / result.getHeight();
if (ratio < canvasRatio) {
result.growWidth(result.getWidth() * (canvasRatio / ratio - 1) / 2);
} else {
result.growHeight(result.getHeight() * (ratio / canvasRatio - 1) / 2);
}
return result;
}