Skip to content

StyleManager cache key uses unresolved fontWidth parameter #107

@Beldaa

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.

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