You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MeasureText gives allways a an empty Size back.
I repleaced the implementation with this one:
public Size MeasureText(string text, Font font)
{
if (text == " ")
{
text = "\u00A0";
}
var textBlock = new TextBlock
{
Text = text,
FontFamily = new FontFamily(font.Family),
FontSize = font.Size,
VerticalAlignment = VerticalAlignment.Top,
HorizontalAlignment = HorizontalAlignment.Left
};
textBlock.Measure(new Windows.Foundation.Size(double.MaxValue, double.MaxValue));
return new Size(textBlock.DesiredSize.Width, textBlock.DesiredSize.Height);
}
Now it is working for me.
Regards,
Sörnt
The text was updated successfully, but these errors were encountered:
soernt
changed the title
Windows Phone RT version - CanvasCanvas.MeasureText is not working correctly
Windows RT version - CanvasCanvas.MeasureText is not working correctly
Mar 8, 2016
MeasureText gives allways a an empty Size back.
I repleaced the implementation with this one:
Now it is working for me.
Regards,
Sörnt
The text was updated successfully, but these errors were encountered: