Remove unnecessary overriding of TextWidget.draw in TextBoxWidget.draw.
[naja.git] / naja / widgets / text.py
index 9eba104065a18a2a84a4a947f683811f8c2e9241..306841257ccaa090238743be176f680ed651a354 100644 (file)
@@ -64,7 +64,7 @@ class TextWidget(Widget):
         self.size = self.surface.get_rect().size
 
     def draw(self, surface):
-        surface.blit(self.surface, self.pos)
+        surface.blit(self.surface, self.rect)
 
 
 class TextBoxWidget(TextWidget):
@@ -143,6 +143,7 @@ class TextBoxWidget(TextWidget):
                         word = glyph.markup_text
                     remaining_words.insert(0, word)
             if current_words and words_fit(current_words):
+                line_count += 1
                 yield ' '.join(current_words)
 
     def prepare(self):
@@ -168,6 +169,3 @@ class TextBoxWidget(TextWidget):
             y += line_surface.get_rect().height
         for pos, img in image_map.items():
             self.surface.blit(img, pos)
-
-    def draw(self, surface):
-        surface.blit(self.surface, self.rect)