[longomatch] Fix rendering text to surfaces
- From: Andoni Morales Alastruey <amorales src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [longomatch] Fix rendering text to surfaces
- Date: Wed, 24 Sep 2014 20:18:34 +0000 (UTC)
commit 20f0ce24e343c9ee45c4175cbe66a1b39a951573
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date: Fri Aug 29 14:25:10 2014 +0200
Fix rendering text to surfaces
LongoMatch.Drawing.Cairo/CairoBackend.cs | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/LongoMatch.Drawing.Cairo/CairoBackend.cs b/LongoMatch.Drawing.Cairo/CairoBackend.cs
index 6e11dae..51c6aa9 100644
--- a/LongoMatch.Drawing.Cairo/CairoBackend.cs
+++ b/LongoMatch.Drawing.Cairo/CairoBackend.cs
@@ -338,14 +338,19 @@ namespace LongoMatch.Drawing.Cairo
public void DrawText (Point point, double width, double height, string text)
{
- Layout layout;
+ Layout layout = null;
Pango.Rectangle inkRect, logRect;
if (text == null) {
return;
}
- layout = (context as CairoContext).PangoLayout;
+ if (context is CairoContext) {
+ layout = (context as CairoContext).PangoLayout;
+ }
+ if (layout == null) {
+ layout = Pango.CairoHelper.CreateLayout (CContext);
+ }
layout.FontDescription = FontDescription.FromString (
String.Format ("{0} {1}px", FontFamily, FontSize));
layout.FontDescription.Weight = fWeight;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]