MCPcopy Create free account
hub / github.com/comaps/comaps / SetSizesToIncludePoint

Method SetSizesToIncludePoint

libs/geometry/rect2d.hpp:193–203  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

191 }
192
193 void SetSizesToIncludePoint(Point<T> const & pt)
194 {
195 Point<T> const c = Center();
196 T const dx = math::Abs(pt.x - c.x);
197 T const dy = math::Abs(pt.y - c.y);
198
199 m_minX = c.x - dx;
200 m_minY = c.y - dy;
201 m_maxX = c.x + dx;
202 m_maxY = c.y + dy;
203 }
204
205 void SetCenter(m2::Point<T> const & p) { Offset(p - Center()); }
206

Callers 2

UNIT_TESTFunction · 0.45
UpdateViewportMethod · 0.45

Calls 1

AbsFunction · 0.85

Tested by 1

UNIT_TESTFunction · 0.36