Author: fejj
Date: 2007-06-20 16:21:26 -0400 (Wed, 20 Jun 2007)
New Revision: 80360
Modified:
trunk/moon/src/ChangeLog
trunk/moon/src/text.cpp
Log:
2007-06-20 Jeffrey Stedfast <[EMAIL PROTECTED]>
* text.cpp (TextBlock): Need to actually set ActualWidth and
ActualHeight values.
Modified: trunk/moon/src/ChangeLog
===================================================================
--- trunk/moon/src/ChangeLog 2007-06-20 20:11:22 UTC (rev 80359)
+++ trunk/moon/src/ChangeLog 2007-06-20 20:21:26 UTC (rev 80360)
@@ -1,3 +1,8 @@
+2007-06-20 Jeffrey Stedfast <[EMAIL PROTECTED]>
+
+ * text.cpp (TextBlock): Need to actually set ActualWidth and
+ ActualHeight values.
+
2007-06-20 Chris Toshok <[EMAIL PROTECTED]>
* clock.cpp (Clock::Tick): if we hit our natural duration but our
Modified: trunk/moon/src/text.cpp
===================================================================
--- trunk/moon/src/text.cpp 2007-06-20 20:11:22 UTC (rev 80359)
+++ trunk/moon/src/text.cpp 2007-06-20 20:21:26 UTC (rev 80360)
@@ -354,6 +354,14 @@
pango_font_description_set_style (font, font_style (style));
FontWeights weight = text_block_get_font_weight (this);
pango_font_description_set_weight (font, font_weight (weight));
+
+ // FIXME: Airlines demo requests actual width/height before
+ // ::getbounds(), ::getxformorigin or ::render() are called,
+ // so we probably need to recompute these values in
+ // OnPropertyChanged? Setting to 0.0, 0.0 for now at least
+ // prevents a crash.
+ text_block_set_actual_height (this, 0.0f);
+ text_block_set_actual_width (this, 0.0f);
}
TextBlock::~TextBlock ()
@@ -404,6 +412,9 @@
Draw (s, false, &width, &height);
cairo_new_path (s->cairo);
cairo_restore (s->cairo);
+
+ text_block_set_actual_height (this, (double) height);
+ text_block_set_actual_width (this, (double) width);
}
// optimization: use the cached width/height and draw
@@ -438,6 +449,9 @@
Draw (s, false, &width, &height);
cairo_new_path (s->cairo);
cairo_restore (s->cairo);
+
+ text_block_set_actual_height (this, (double) height);
+ text_block_set_actual_width (this, (double) width);
}
return Point (user_xform_origin.x * width, user_xform_origin.y *
height);
@@ -482,6 +496,9 @@
Draw (s, false, &this->width, &this->height);
cairo_new_path (s->cairo);
cairo_restore (s->cairo);
+
+ text_block_set_actual_height (this, (double) this->height);
+ text_block_set_actual_width (this, (double) this->width);
}
*height = (double) this->height;
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches