[core] Introduce variable text placement for point labels - Render part
This commit is contained in:
committed by
Mikhail Pozdnyakov
parent
dbbfc4a494
commit
cb64dbe0d6
@@ -42,6 +42,7 @@ std::unique_ptr<SymbolSizeBinder> SymbolSizeBinder::create(const float tileZoom,
|
||||
|
||||
template <class Values, class...Args>
|
||||
Values makeValues(const bool isText,
|
||||
const bool hasVariablePacement,
|
||||
const style::SymbolPropertyValues& values,
|
||||
const Size& texsize,
|
||||
const std::array<float, 2>& pixelsToGLUnits,
|
||||
@@ -71,7 +72,7 @@ Values makeValues(const bool isText,
|
||||
const bool rotateInShader = rotateWithMap && !pitchWithMap && !alongLine;
|
||||
|
||||
mat4 labelPlaneMatrix;
|
||||
if (alongLine) {
|
||||
if (alongLine || (isText && hasVariablePacement)) {
|
||||
// For labels that follow lines the first part of the projection is handled on the cpu.
|
||||
// Pass an identity matrix because no transformation needs to be done in the vertex shader.
|
||||
matrix::identity(labelPlaneMatrix);
|
||||
@@ -106,6 +107,7 @@ Values makeValues(const bool isText,
|
||||
|
||||
SymbolIconProgram::LayoutUniformValues
|
||||
SymbolIconProgram::layoutUniformValues(const bool isText,
|
||||
const bool hasVariablePacement,
|
||||
const style::SymbolPropertyValues& values,
|
||||
const Size& texsize,
|
||||
const std::array<float, 2>& pixelsToGLUnits,
|
||||
@@ -115,6 +117,7 @@ SymbolIconProgram::layoutUniformValues(const bool isText,
|
||||
const float symbolFadeChange) {
|
||||
return makeValues<SymbolIconProgram::LayoutUniformValues>(
|
||||
isText,
|
||||
hasVariablePacement,
|
||||
values,
|
||||
texsize,
|
||||
pixelsToGLUnits,
|
||||
@@ -128,6 +131,7 @@ SymbolIconProgram::layoutUniformValues(const bool isText,
|
||||
template <class Name, class PaintProperties>
|
||||
typename SymbolSDFProgram<Name, PaintProperties>::LayoutUniformValues
|
||||
SymbolSDFProgram<Name, PaintProperties>::layoutUniformValues(const bool isText,
|
||||
const bool hasVariablePacement,
|
||||
const style::SymbolPropertyValues& values,
|
||||
const Size& texsize,
|
||||
const std::array<float, 2>& pixelsToGLUnits,
|
||||
@@ -142,6 +146,7 @@ SymbolSDFProgram<Name, PaintProperties>::layoutUniformValues(const bool isText,
|
||||
|
||||
return makeValues<SymbolSDFProgram<Name, PaintProperties>::LayoutUniformValues>(
|
||||
isText,
|
||||
hasVariablePacement,
|
||||
values,
|
||||
texsize,
|
||||
pixelsToGLUnits,
|
||||
|
||||
Reference in New Issue
Block a user