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

Method GetPixelRect

libs/drape/overlay_handle.cpp:188–209  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

186{}
187
188m2::RectD SquareHandle::GetPixelRect(ScreenBase const & screen, bool perspective) const
189{
190 if (perspective)
191 return GetPixelRectPerspective(screen);
192
193 m2::PointD const pxPivot = screen.GtoP(m_gbPivot) + m_pxOffset;
194 m2::RectD result(pxPivot - m_pxHalfSize, pxPivot + m_pxHalfSize);
195 m2::PointD offset(0.0, 0.0);
196
197 if (m_anchor & dp::Left)
198 offset.x = m_pxHalfSize.x;
199 else if (m_anchor & dp::Right)
200 offset.x = -m_pxHalfSize.x;
201
202 if (m_anchor & dp::Top)
203 offset.y = m_pxHalfSize.y;
204 else if (m_anchor & dp::Bottom)
205 offset.y = -m_pxHalfSize.y;
206
207 result.Offset(offset);
208 return result;
209}
210
211void SquareHandle::GetPixelShape(ScreenBase const & screen, bool perspective, Rects & rects) const
212{

Callers 2

RenderDebugMethod · 0.45

Calls 2

GtoPMethod · 0.45
OffsetMethod · 0.45

Tested by

no test coverage detected