Skip to content

StyleManager cache key uses unresolved fontWidth parameter #107

Description

@Beldaa

In StyleManager.GetStyle(), the cache key is constructed using the fontWidth parameter (which is a nullable SKFontStyleWidth?) instead of the resolved rFontWidth value.

// Current code (StyleManager.cs line 164):
var key = (fontFamily, fontSize, fontWeight, fontWidth, fontItalic);

// Resolved value:
var rFontWidth = fontWidth ?? SKFontStyleWidth.Normal;

This causes styles with different font widths to collide in the cache if the input fontWidth is null (defaulting to Normal), which can lead to incorrect styles being returned from the cache.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions