Author: stephane
Date: 2008-02-21 04:27:29 -0500 (Thu, 21 Feb 2008)
New Revision: 96325
Modified:
trunk/moon/src/ChangeLog
trunk/moon/src/text.cpp
trunk/moon/src/text.h
Log:
2008-02-21 Stephane Delcroix <[EMAIL PROTECTED]>
* text.h|cpp: compute GetOriginPoint and fix GetSizeForBrush
Modified: trunk/moon/src/ChangeLog
===================================================================
--- trunk/moon/src/ChangeLog 2008-02-21 01:38:35 UTC (rev 96324)
+++ trunk/moon/src/ChangeLog 2008-02-21 09:27:29 UTC (rev 96325)
@@ -1,3 +1,7 @@
+2008-02-21 Stephane Delcroix <[EMAIL PROTECTED]>
+
+ * text.h|cpp: compute GetOriginPoint and fix GetSizeForBrush
+
2008-02-20 Jeffrey Stedfast <[EMAIL PROTECTED]>
Fixes the TextBlockFontDownloads.htm test.
Modified: trunk/moon/src/text.cpp
===================================================================
--- trunk/moon/src/text.cpp 2008-02-21 01:38:35 UTC (rev 96324)
+++ trunk/moon/src/text.cpp 2008-02-21 09:27:29 UTC (rev 96325)
@@ -1519,10 +1519,23 @@
if (dirty)
Layout ();
- *height = this->height;
- *width = this->width;
+ *height = desc->GetFont ()->Height ();
+ *width = this->width - origin_x;
}
+Point
+Glyphs::GetOriginPoint ()
+{
+ if (!origin_y_specified)
+ return Point (origin_x, 0);
+ else {
+ double d = desc->GetFont ()->Descender ();
+ double h = desc->GetFont ()->Height ();
+ printf ("y d h: %f %f %f\n", origin_y, d, h);
+ return Point (origin_x, origin_y - d - h);
+ }
+}
+
void
Glyphs::Render (cairo_t *cr, int x, int y, int width, int height)
{
Modified: trunk/moon/src/text.h
===================================================================
--- trunk/moon/src/text.h 2008-02-21 01:38:35 UTC (rev 96324)
+++ trunk/moon/src/text.h 2008-02-21 09:27:29 UTC (rev 96325)
@@ -282,6 +282,7 @@
virtual void Render (cairo_t *cr, int x, int y, int width, int height);
virtual void ComputeBounds ();
virtual Point GetTransformOrigin ();
+ virtual Point GetOriginPoint ();
virtual void OnPropertyChanged (DependencyProperty *prop);
virtual void OnSubPropertyChanged (DependencyProperty *prop,
DependencyObject *obj, DependencyProperty *subprop);
};
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches