CVSROOT: /sources/gnash Module name: gnash Changes by: Sandro Santilli <strk> 07/08/21 00:33:13
Modified files: . : ChangeLog server : edit_text_character.cpp edit_text_character.h Log message: reformat text when _width or _height changes. CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.4050&r2=1.4051 http://cvs.savannah.gnu.org/viewcvs/gnash/server/edit_text_character.cpp?cvsroot=gnash&r1=1.101&r2=1.102 http://cvs.savannah.gnu.org/viewcvs/gnash/server/edit_text_character.h?cvsroot=gnash&r1=1.45&r2=1.46 Patches: Index: ChangeLog =================================================================== RCS file: /sources/gnash/gnash/ChangeLog,v retrieving revision 1.4050 retrieving revision 1.4051 diff -u -b -r1.4050 -r1.4051 --- ChangeLog 21 Aug 2007 00:07:22 -0000 1.4050 +++ ChangeLog 21 Aug 2007 00:33:13 -0000 1.4051 @@ -1,7 +1,8 @@ 2007-08-21 Sandro Santilli <[EMAIL PROTECTED]> * server/edit_text_character.cpp (add_invalidated_bounds): use - instance bounds, not definition ones. + instance bounds, not definition ones; reformat text when _width + or _height changes. * testsuite/misc-swfc.all/Makefile.am: use an absolute path for MEDIADIR to make swfc happy; don't do anything on make check if SWFC is not enabled. Index: server/edit_text_character.cpp =================================================================== RCS file: /sources/gnash/gnash/server/edit_text_character.cpp,v retrieving revision 1.101 retrieving revision 1.102 diff -u -b -r1.101 -r1.102 --- server/edit_text_character.cpp 21 Aug 2007 00:07:22 -0000 1.101 +++ server/edit_text_character.cpp 21 Aug 2007 00:33:13 -0000 1.102 @@ -17,7 +17,7 @@ // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // -/* $Id: edit_text_character.cpp,v 1.101 2007/08/21 00:07:22 strk Exp $ */ +/* $Id: edit_text_character.cpp,v 1.102 2007/08/21 00:33:13 strk Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -526,9 +526,11 @@ ranges.add(m_old_invalidated_ranges); - geometry::Range2d<float> bounds = getBounds(); - get_world_matrix().transform(bounds); + matrix wm = get_world_matrix(); + geometry::Range2d<float> bounds = getBounds(); + bounds.expandTo(m_text_bounding_box); // add text bounds + wm.transform(bounds); ranges.add(bounds); } @@ -792,6 +794,11 @@ _bounds.setTo(xmin, ymin, xmin+nw, ymax); assert(_bounds.width() == nw); + // previously truncated text might get visible now + // TODO: if nested masks were implemented we would + // not need to reformat text here + format_text(); + return; } case M_HEIGHT: // _height @@ -827,6 +834,11 @@ assert(_bounds.height() == nh); + // previously truncated text might get visible now + // TODO: if nested masks were implemented we would + // not need to reformat text here + format_text(); + return; } case M_VISIBLE: @@ -1068,7 +1080,7 @@ // Expand the bounding-box to the lower-right corner of each glyph as // we generate it. - m_text_bounding_box.expand_to_point(x, y + _font->get_descent() * scale); + m_text_bounding_box.expandTo(x, y + _font->get_descent() * scale); if (code == 13 || code == 10) { Index: server/edit_text_character.h =================================================================== RCS file: /sources/gnash/gnash/server/edit_text_character.h,v retrieving revision 1.45 retrieving revision 1.46 diff -u -b -r1.45 -r1.46 --- server/edit_text_character.h 16 Aug 2007 10:31:51 -0000 1.45 +++ server/edit_text_character.h 21 Aug 2007 00:33:13 -0000 1.46 @@ -225,12 +225,12 @@ boost::intrusive_ptr<edit_text_character_def> m_def; /// bounds of dynamic text, as laid out - rect m_text_bounding_box; + geometry::Range2d<float> m_text_bounding_box; /// Reset our text bounding box to the given point. void reset_bounding_box(float x, float y) { - m_text_bounding_box.enclose_point(x,y); + m_text_bounding_box.setTo(x,y); } typedef std::vector<text_glyph_record> TextGlyphRecords; _______________________________________________ Gnash-commit mailing list Gnash-commit@gnu.org http://lists.gnu.org/mailman/listinfo/gnash-commit