[core] don't access empty texture pos optionals when buckets are out of sync

This commit is contained in:
Konstantin Käfer
2019-03-27 10:11:03 +01:00
parent d97ff6ae05
commit 7f28afc507
2 changed files with 3 additions and 3 deletions

View File

@@ -143,8 +143,8 @@ void RenderLineLayer::render(PaintParameters& parameters, RenderSource*) {
texsize,
crossfade,
parameters.pixelRatio),
*posA,
*posB,
posA,
posB,
LinePatternProgram::TextureBindings{
textures::image::Value{ *geometryTile.iconAtlasTexture->resource, gfx::TextureFilterType::Linear },
});

View File

@@ -148,7 +148,7 @@ public:
void upload(gfx::Context&) override {}
void setPatternParameters(const optional<ImagePosition>& posA, const optional<ImagePosition>& posB, CrossfadeParameters&) override {
if (!posA && !posB) {
if (!posA || !posB) {
return;
} else {
constantPatternPositions = std::tuple<std::array<uint16_t, 4>, std::array<uint16_t, 4>> { posB->tlbr(), posA->tlbr() };