[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog server/edit_text_character.cpp [release-0
From: |
Udo Giacomozzi |
Subject: |
[Gnash-commit] gnash ChangeLog server/edit_text_character.cpp [release-0-8-0] |
Date: |
Fri, 08 Jun 2007 08:18:03 +0000 |
CVSROOT: /cvsroot/gnash
Module name: gnash
Branch: release-0-8-0
Changes by: Udo Giacomozzi <udog> 07/06/08 08:18:03
Modified files:
. : ChangeLog
server : edit_text_character.cpp
Log message:
server/edit_text_character.cpp: replace WIDTH_FUDGE with PADDING_TWIPS
and correct some border issues (backport)
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&only_with_tag=release-0-8-0&r1=1.3451.2.46&r2=1.3451.2.47
http://cvs.savannah.gnu.org/viewcvs/gnash/server/edit_text_character.cpp?cvsroot=gnash&only_with_tag=release-0-8-0&r1=1.62&r2=1.62.4.1
Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/gnash/gnash/ChangeLog,v
retrieving revision 1.3451.2.46
retrieving revision 1.3451.2.47
diff -u -b -r1.3451.2.46 -r1.3451.2.47
--- ChangeLog 7 Jun 2007 22:15:45 -0000 1.3451.2.46
+++ ChangeLog 8 Jun 2007 08:18:00 -0000 1.3451.2.47
@@ -1,3 +1,8 @@
+2007-06-07 Udo Giacomozzi <address@hidden>
+
+ * server/edit_text_character.cpp: replace WIDTH_FUDGE with PADDING_TWIPS
+ and correct some border issues (backport)
+
2007-06-07 Tomas Groth Christensen <address@hidden>
* libbase/embedVideoDecoderFfmpeg.cpp: Free the av_frame after use.
Index: server/edit_text_character.cpp
===================================================================
RCS file: /cvsroot/gnash/gnash/server/edit_text_character.cpp,v
retrieving revision 1.62
retrieving revision 1.62.4.1
diff -u -b -r1.62 -r1.62.4.1
--- server/edit_text_character.cpp 26 Apr 2007 10:56:50 -0000 1.62
+++ server/edit_text_character.cpp 8 Jun 2007 08:18:02 -0000 1.62.4.1
@@ -17,7 +17,7 @@
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
-/* $Id: edit_text_character.cpp,v 1.62 2007/04/26 10:56:50 zoulunkai Exp $ */
+/* $Id: edit_text_character.cpp,v 1.62.4.1 2007/06/08 08:18:02 udog Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -42,6 +42,10 @@
#include <string>
#include <boost/algorithm/string/case_conv.hpp>
+// Text fields have a fixed 2 pixel padding for each side (regardless of
border)
+#define PADDING_TWIPS 40.0f
+
+
namespace gnash {
// Forward declarations
@@ -451,10 +455,13 @@
// m_x_offset and m_y_offset memebers in glyph records.
// Anyway, see bug #17954 for a testcase.
matrix m;
+
if ( ! def_bounds.is_null() && ! def_bounds.is_world() )
{
- m.set_translation(def_bounds.get_x_min(),
def_bounds.get_y_min());
+ m.concatenate_translation(def_bounds.get_x_min(),
def_bounds.get_y_min());
}
+
+
display_glyph_records(m, this, m_text_glyph_records,
m_def->get_root_def());
@@ -828,10 +835,6 @@
return get_member_default(name, val);
}
-// @@ WIDTH_FUDGE is a total fudge to make it match the Flash player! Maybe
-// we have a bug?
-#define WIDTH_FUDGE 80.0f
-
float
edit_text_character::align_line(
@@ -842,7 +845,7 @@
assert(m_def);
float extra_space = (m_def->width() -
- m_def->get_right_margin()) - x - WIDTH_FUDGE;
+ m_def->get_right_margin()) - x - PADDING_TWIPS;
//assert(extra_space >= 0.0f);
if (extra_space <= 0.0f)
@@ -956,8 +959,8 @@
text_glyph_record rec; // one to work on
rec.m_style.m_font = _font;
rec.m_style.m_color = m_def->get_text_color();
- rec.m_style.m_x_offset = std::max(0, m_def->get_left_margin() +
m_def->get_indent());
- rec.m_style.m_y_offset = m_def->get_font_height()
+ rec.m_style.m_x_offset = PADDING_TWIPS + std::max(0,
m_def->get_left_margin() + m_def->get_indent());
+ rec.m_style.m_y_offset = PADDING_TWIPS + m_def->get_font_height()
+ (_font->get_leading() - _font->get_descent()) * scale;
rec.m_style.m_text_height = m_def->get_font_height();
rec.m_style.m_has_x_offset = true;
@@ -1018,7 +1021,8 @@
align_line(m_def->get_alignment(),
last_line_start_record, x);
// new paragraphs get the indent.
- x = std::max(0, m_def->get_left_margin() +
m_def->get_indent());
+ x = std::max(0, m_def->get_left_margin() +
m_def->get_indent()) +
+ PADDING_TWIPS;
y += m_def->get_font_height() + leading;
// Start a new record on the next line.
@@ -1132,7 +1136,7 @@
after_x_advance:
- if (x >= m_def->width() - m_def->get_right_margin() -
WIDTH_FUDGE)
+ if (x >= m_def->width() - m_def->get_right_margin() -
PADDING_TWIPS)
{
// Whoops, we just exceeded the box width.
// Do word-wrap if requested to do so.
@@ -1152,8 +1156,7 @@
// Close out this stretch of glyphs.
m_text_glyph_records.push_back(rec);
float previous_x = x;
-
- x = m_def->get_left_margin();
+ x = m_def->get_left_margin() + PADDING_TWIPS;
y += m_def->get_font_height() + leading;
// Start a new record on the next line.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] gnash ChangeLog server/edit_text_character.cpp [release-0-8-0],
Udo Giacomozzi <=