Conversation
Update FontStyle to add a typeface cache to avoid to call too often the font face lookup table. This should solve issue ScottPlot#2833
fix string comparison issue: comparing string content not string holder!
|
Thank you for this fantastic solution @KroMignon! I really appreciate your work improving ScottPlot 5 performance with this pull request 🚀 A few thoughts about this work:
// strategy in the original PR
protected bool SetField<T>(ref T fieldValue, T value)
{
if (value is string)
{
if (string.Compare(fieldValue as string, value as string) == 0)
return false;
}
else if (Equals(fieldValue, value))
return false;
fieldValue = value;
_typeface = null;
return true;
}Thank you again for this excellent work! 🙏 |
Update FontStyle to add a typeface cache to avoid to call too often the font face lookup table.
This should solve issue #2833