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

Function ShiftNormal

libs/drape_frontend/poi_symbol_shape.cpp:27–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25using MV = gpu::MaskedTexturingVertex;
26
27glsl::vec2 ShiftNormal(glsl::vec2 const & n, df::PoiSymbolViewParams const & params, m2::PointF const & pixelSize)
28{
29 glsl::vec2 result = n + glsl::vec2(params.m_offset.x, params.m_offset.y);
30 m2::PointF const halfPixelSize = pixelSize * 0.5f;
31
32 if (params.m_anchor & dp::Top)
33 result.y += halfPixelSize.y;
34 else if (params.m_anchor & dp::Bottom)
35 result.y -= halfPixelSize.y;
36
37 if (params.m_anchor & dp::Left)
38 result.x += halfPixelSize.x;
39 else if (params.m_anchor & dp::Right)
40 result.x -= halfPixelSize.x;
41
42 return result;
43}
44
45template <typename TCreateOverlayHandle>
46void SolidBatch(ref_ptr<dp::GraphicsContext> context, ref_ptr<dp::Batcher> batcher,

Callers 2

SolidBatchFunction · 0.70
MaskedBatchFunction · 0.70

Calls 1

vec2Class · 0.85

Tested by

no test coverage detected