gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] /srv/bzr/gnash/trunk r11379: Fix a small bug. First chara


From: Bob Naugle
Subject: [Gnash-commit] /srv/bzr/gnash/trunk r11379: Fix a small bug. First character is no longer displayed after it's deleted.
Date: Thu, 06 Aug 2009 15:19:10 -0600
User-agent: Bazaar (1.16.1)

------------------------------------------------------------
revno: 11379
committer: Bob Naugle <address@hidden>
branch nick: trunk
timestamp: Thu 2009-08-06 15:19:10 -0600
message:
  Fix a small bug. First character is no longer displayed after it's deleted.
modified:
  libcore/TextField.cpp
=== modified file 'libcore/TextField.cpp'
--- a/libcore/TextField.cpp     2009-08-06 21:04:55 +0000
+++ b/libcore/TextField.cpp     2009-08-06 21:19:10 +0000
@@ -396,7 +396,28 @@
     if (!_bounds.is_null()) {
         m.concatenate_translation(_bounds.get_x_min(), _bounds.get_y_min()); 
     }
-    
+
+    _displayRecords.clear();
+    float scale = getFontHeight() / (float)_font->unitsPerEM(_embedFonts);
+    float fontLeading = _font->leading() * scale;
+    //offset the lines
+    int yoffset = (getFontHeight() + fontLeading) + PADDING_TWIPS;
+    size_t recordline;
+    for (size_t i = 0; i < _textRecords.size(); ++i) {
+        recordline = 0;
+        //find the line the record is on
+        while (recordline < _line_starts.size() && _line_starts[recordline] <= 
_recordStarts[i]) {
+            ++recordline;
+        }
+        //offset the line
+        _textRecords[i].setYOffset((recordline-_scroll)*yoffset);
+        //add the lines we want to the display record
+        if (_textRecords[i].yOffset() > 0 &&
+            _textRecords[i].yOffset() < _bounds.height()) {
+            _displayRecords.push_back(_textRecords[i]);
+        }
+    }
+        
     SWF::TextRecord::displayRecords(renderer, m, get_world_cxform(),
             _displayRecords, _embedFonts);
 
@@ -1502,7 +1523,6 @@
 void
 TextField::scrollLines()
 {
-    _displayRecords.clear();
     boost::uint16_t fontHeight = getFontHeight();
     float scale = fontHeight / (float)_font->unitsPerEM(_embedFonts);
     float fontLeading = _font->leading() * scale;
@@ -1539,23 +1559,6 @@
                 _scroll += line - (lastvisibleline);
             }
         }
-        //offset the lines
-        int yoffset = (fontHeight + fontLeading) + PADDING_TWIPS;
-        size_t recordline;
-        for (size_t i = 0; i < _textRecords.size(); ++i) {
-            recordline = 0;
-            //find the line the record is on
-            while (recordline < manylines && _line_starts[recordline] <= 
_recordStarts[i]) {
-                ++recordline;
-            }
-            //offset the line
-            _textRecords[i].setYOffset((recordline-_scroll)*yoffset);
-            //add the lines we want to the display record
-            if (_textRecords[i].yOffset() > 0 &&
-                _textRecords[i].yOffset() < _bounds.height()) {
-                _displayRecords.push_back(_textRecords[i]);
-            }
-        }
     }
 }
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]