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

Function PixelPointToScreenSpace

libs/drape_frontend/debug_rect_renderer.cpp:18–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16namespace
17{
18void PixelPointToScreenSpace(ScreenBase const & screen, m2::PointF const & pt, std::vector<float> & buffer)
19{
20 auto const szX = static_cast<float>(screen.PixelRectIn3d().SizeX());
21 auto const szY = static_cast<float>(screen.PixelRectIn3d().SizeY());
22
23 buffer.push_back(2.0f * (pt.x / szX - 0.5f));
24 buffer.push_back(2.0f * (-pt.y / szY + 0.5f));
25}
26
27drape_ptr<dp::MeshObject> CreateMesh(ref_ptr<dp::GraphicsContext> context, ref_ptr<dp::GpuProgram> program,
28 std::vector<float> && vertices, std::string const & debugName)

Callers 2

SetArrowMethod · 0.85
SetRectMethod · 0.85

Calls 3

SizeXMethod · 0.80
SizeYMethod · 0.80
push_backMethod · 0.45

Tested by

no test coverage detected