MCPcopy Create free account
hub / github.com/OneLoneCoder/olcPixelGameEngine / IsRectVisible

Method IsRectVisible

extensions/olcPGEX_TransformedView.h:380–385  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

378 }
379
380 bool TransformedView::IsRectVisible(const olc::vf2d& vPos, const olc::vf2d& vSize) const
381 {
382 olc::vi2d vScreenPos = WorldToScreen(vPos);
383 olc::vi2d vScreenSize = vSize * m_vWorldScale;
384 return (vScreenPos.x < 0 + m_vViewArea.x && vScreenPos.x + vScreenSize.x > 0 && vScreenPos.y < m_vViewArea.y&& vScreenPos.y + vScreenSize.y > 0);
385 }
386
387 void TransformedView::HandlePanAndZoom(const int nMouseButton, const float fZoomRate, const bool bPan, const bool bZoom)
388 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected