MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / addUpdateRegion

Method addUpdateRegion

Engine/source/gui/core/guiCanvas.cpp:2098–2116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2096}
2097
2098void GuiCanvas::addUpdateRegion(Point2I pos, Point2I ext)
2099{
2100 if(mCurUpdateRect.extent.x == 0)
2101 {
2102 mCurUpdateRect.point = pos;
2103 mCurUpdateRect.extent = ext;
2104 }
2105 else
2106 {
2107 Point2I upperL;
2108 upperL.x = getMin(mCurUpdateRect.point.x, pos.x);
2109 upperL.y = getMin(mCurUpdateRect.point.y, pos.y);
2110 Point2I lowerR;
2111 lowerR.x = getMax(mCurUpdateRect.point.x + mCurUpdateRect.extent.x, pos.x + ext.x);
2112 lowerR.y = getMax(mCurUpdateRect.point.y + mCurUpdateRect.extent.y, pos.y + ext.y);
2113 mCurUpdateRect.point = upperL;
2114 mCurUpdateRect.extent = lowerR - upperL;
2115 }
2116}
2117
2118void GuiCanvas::resetUpdateRegions()
2119{

Callers 2

setUpdateRegionMethod · 0.80
onMouseDraggedMethod · 0.80

Calls 1

getMaxFunction · 0.85

Tested by

no test coverage detected