Skip to content

Commit

Permalink
fix example text very slow on large files
Browse files Browse the repository at this point in the history
  • Loading branch information
NotFound committed Dec 9, 2011
1 parent 766e443 commit d2ddd6e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion examples/text.winxed
Expand Up @@ -58,19 +58,23 @@ class TextWindow : TopLevelWindow
string text = self.text;
int pos = 0;
int hfont = self.font.getHeight();
int height = self.height;
int y = 0;
int start = self.start;
int line = 0;
for (int p in self.chunks) {
if (line >= start) {
y += hfont;
if (y > height)
break;
self.DrawImageString(0, y, substr(self.text, pos, p - pos - 1));
}
pos = p;
++line;
}
y += hfont;
self.DrawImageString(0, y, substr(self.text, pos));
if (y <= height)
self.DrawImageString(0, y, substr(self.text, pos));
}
function copyall()
{
Expand Down

0 comments on commit d2ddd6e

Please sign in to comment.