summaryrefslogtreecommitdiff
path: root/src/mbgl/programs/symbol_program.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl/programs/symbol_program.cpp')
-rw-r--r--src/mbgl/programs/symbol_program.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/mbgl/programs/symbol_program.cpp b/src/mbgl/programs/symbol_program.cpp
index 07d07ff0dd..3b5473955c 100644
--- a/src/mbgl/programs/symbol_program.cpp
+++ b/src/mbgl/programs/symbol_program.cpp
@@ -46,13 +46,15 @@ Values makeValues(const bool isText,
const float symbolFadeChange,
Args&&... args) {
std::array<float, 2> extrudeScale;
+ const float cameraToCenterDistance = state.getCameraToCenterDistance();
+ const float pitch = state.getPitch();
if (values.pitchAlignment == AlignmentType::Map) {
extrudeScale.fill(tile.id.pixelsToTileUnits(1, state.getZoom()));
} else {
extrudeScale = {{
- pixelsToGLUnits[0] * state.getCameraToCenterDistance(),
- pixelsToGLUnits[1] * state.getCameraToCenterDistance()
+ pixelsToGLUnits[0] * cameraToCenterDistance,
+ pixelsToGLUnits[1] * cameraToCenterDistance
}};
}
@@ -91,8 +93,8 @@ Values makeValues(const bool isText,
uniforms::u_texture::Value{ 0 },
uniforms::u_fade_change::Value{ symbolFadeChange },
uniforms::u_is_text::Value{ isText },
- uniforms::u_camera_to_center_distance::Value{ state.getCameraToCenterDistance() },
- uniforms::u_pitch::Value{ state.getPitch() },
+ uniforms::u_camera_to_center_distance::Value{ cameraToCenterDistance },
+ uniforms::u_pitch::Value{ pitch },
uniforms::u_pitch_with_map::Value{ pitchWithMap },
uniforms::u_rotate_symbol::Value{ rotateInShader },
uniforms::u_aspect_ratio::Value{ state.getSize().aspectRatio() },