don't permanently crossfade line patterns
js: a2e8527b4023d19fa0c58130a105aaf283f4b152
This commit is contained in:
@@ -70,6 +70,10 @@ void Painter::renderLine(LineBucket& bucket, util::ptr<StyleLayer> layer_desc, c
|
||||
bucket.drawPoints(*linejoinShader);
|
||||
}
|
||||
|
||||
float duration = 300 * 1_millisecond;
|
||||
const float fraction = std::fmod(float(state.getZoom()), 1.0f);
|
||||
float t = std::min((util::now() - lastIntegerZoomTime) / duration, 1.0f);
|
||||
|
||||
if (properties.dash_array.size()) {
|
||||
|
||||
useProgram(linesdfShader->program);
|
||||
@@ -99,7 +103,15 @@ void Painter::renderLine(LineBucket& bucket, util::ptr<StyleLayer> layer_desc, c
|
||||
SpriteAtlasPosition imagePos = spriteAtlas.getPosition(properties.image, true);
|
||||
|
||||
float factor = 8.0 / std::pow(2, state.getIntegerZoom() - id.z);
|
||||
float fade = std::fmod(state.getZoom(), 1.0);
|
||||
float fade;
|
||||
if (state.getZoom() > lastIntegerZoom) {
|
||||
// zooming in
|
||||
fade = fraction + (1.0f - fraction) * t;
|
||||
factor *= 2.0;
|
||||
} else {
|
||||
// zooming out
|
||||
fade = fraction - fraction * t;
|
||||
}
|
||||
|
||||
useProgram(linepatternShader->program);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user