From 7d23554e9e00626c9e14e5edf995a30daff12523 Mon Sep 17 00:00:00 2001 From: Andres Mandado Date: Mon, 2 Dec 2019 13:20:56 +0100 Subject: [PATCH] HARP-7916: Add comment to explain when new label pass must be rendered. Signed-off-by: Andres Mandado --- @here/harp-mapview/lib/text/TextElementsRenderer.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/@here/harp-mapview/lib/text/TextElementsRenderer.ts b/@here/harp-mapview/lib/text/TextElementsRenderer.ts index 55a1435ad8..00be1d11bb 100644 --- a/@here/harp-mapview/lib/text/TextElementsRenderer.ts +++ b/@here/harp-mapview/lib/text/TextElementsRenderer.ts @@ -371,6 +371,13 @@ export class TextElementsRenderer { this.reset(); this.prepopulateScreenWithBlockingElements(dataSourceTileList); + + // New text elements must be placed either if text elements were updated in this frame + // or if any text element group was evicted. The second case happens when the group is not + // visited anymore and all it's elements just became invisible, which means there's newly + // available screen space where new text elements could be placed. A common scenario where + // this happens is zooming in/out: text groups from the old level may still be fading out + // after all groups in the new level were updated. const placeNewTextElements = updateTextElements || anyTextGroupEvicted; this.placeTextElements(time, placeNewTextElements); this.placeOverlayTextElements();