Browse Source

Temporary fix for that weird crash

pull/213/head
Nikita Tsukanov 11 years ago
parent
commit
dd83f0b6dc
  1. 2
      src/Gtk/Perspex.Cairo/Media/FormattedTextImpl.cs
  2. 3
      src/Perspex.SceneGraph/Media/FormattedText.cs

2
src/Gtk/Perspex.Cairo/Media/FormattedTextImpl.cs

@ -25,7 +25,7 @@ namespace Perspex.Cairo.Media
FontWeight fontWeight)
{
Contract.Requires<NullReferenceException>(context != null);
Contract.Requires<NullReferenceException> (text != null);
Layout = new Pango.Layout(context);
_text = text;
Layout.SetText(text);

3
src/Perspex.SceneGraph/Media/FormattedText.cs

@ -29,6 +29,9 @@ namespace Perspex.Media
TextAlignment textAlignment,
FontWeight fontWeight)
{
//TODO: Find out why it was null in the first place. Demo project - AvalonStudio
//https://github.com/VitalElement/AvalonStudio/commit/787fb9396feb74e6ca6bd4e08436269a349df9c6
text = text ?? "";
Text = text;
FontFamilyName = fontFamilyName;
FontSize = fontSize;

Loading…
Cancel
Save