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

Method GetPixelRect

libs/drape_frontend/path_text_handle.cpp:285–308  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

283}
284
285m2::RectD PathTextHandle::GetPixelRect(ScreenBase const & screen, bool perspective) const
286{
287 m2::PointD const pixelPivot(screen.GtoP(m_globalPivot));
288
289 if (perspective)
290 {
291 if (IsBillboard())
292 {
293 m2::RectD r = GetPixelRect(screen, false);
294 m2::PointD pixelPivotPerspective = screen.PtoP3d(pixelPivot);
295 r.Offset(-pixelPivot);
296 r.Offset(pixelPivotPerspective);
297
298 return r;
299 }
300 return GetPixelRectPerspective(screen);
301 }
302
303 m2::RectD result;
304 for (gpu::TextDynamicVertex const & v : m_buffer)
305 result.Add(pixelPivot + m2::PointD(glsl::ToPoint(v.m_normal)));
306
307 return result;
308}
309
310void PathTextHandle::GetPixelShape(ScreenBase const & screen, bool perspective, Rects & rects) const
311{

Callers

nothing calls this directly

Calls 5

ToPointFunction · 0.85
PtoP3dMethod · 0.80
GtoPMethod · 0.45
OffsetMethod · 0.45
AddMethod · 0.45

Tested by

no test coverage detected