Skip to content

Conversation

@matzf
Copy link
Contributor

@matzf matzf commented Jan 9, 2026

hasIconPotentially logic tries to filter out symbols that never need to be drawn. For this, we tried to evaluate icon-image expression with zoom/state independent context and if that is successful and an empty string we know it will never have an icon.

This was flawed. First, there was a logic error. Should have been

        hasIconPotentially = (iconImage == nullptr || !iconImage->empty());

instead of

        hasIconPotentially = (iconImage != nullptr && !iconImage->empty());

Also, the zoom-indpendent evaluation does not work as was assumed. The assumption was that accessing state or zoom in an expression would always result in std::monostate value to indicate evaluation failure. However that's not consistently the case. For example, "step" expressions will return the first value in such a case.

Finally, it did not correctly handle result values other than strings, breaking it e.g. for "concat" expressions.

Fixed by relying on (more conservative) usedKeys.

Fixes "Filter symbols with neither text nor icon early" (e0e2e54)

@matzf matzf requested a review from zimmermannubique January 9, 2026 13:40
hasIconPotentially logic tries to filter out symbols that never need to be
drawn. For this, we tried to evaluate icon-image expression with
zoom/state independent context and if that is successful and an empty
string we know it will never have an icon.

This was flawed. First, there was a logic error. Should have been

            hasIconPotentially = (iconImage == nullptr || !iconImage->empty());

instead of

            hasIconPotentially = (iconImage != nullptr && !iconImage->empty());

Also, the zoom-indpendent evaluation does not work as was assumed. The
assumption was that accessing state or zoom in an expression would
always result in std::monostate value to indicate evaluation failure.
However that's not consistently the case. For example, "step"
expressions will return the first value in such a case.

Finally, it did not correctly handle result values other than strings,
breaking it e.g. for "concat" expressions.

Fixed by relying on (more conservative) usedKeys.

Fixes "Filter symbols with neither text nor icon early" (e0e2e54)
@matzf matzf force-pushed the bugfix/has-icon-potentially branch from e8d453b to d7b5b2b Compare January 9, 2026 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants