From f030154fe727e25a2afe1f78b3998c2d2dba95e4 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Tue, 18 Aug 2009 09:24:15 +0000 Subject: astyle cleanup, corrects not loading of material textures --- src/ui/scrollpane.cc | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'src/ui/scrollpane.cc') diff --git a/src/ui/scrollpane.cc b/src/ui/scrollpane.cc index 20325d8..463956d 100644 --- a/src/ui/scrollpane.cc +++ b/src/ui/scrollpane.cc @@ -22,7 +22,7 @@ ScrollPane::ScrollPane(Widget *parent, ui::Text &text) : Widget(parent), scrollp ScrollPane::~ScrollPane() { } - + void ScrollPane::set_alignment(const unsigned int alignment) { scrollpane_alignment = alignment; @@ -68,7 +68,7 @@ void ScrollPane::draw() scrollpane_scroll = (int) scrollpane_text.size(); else if (scrollpane_scroll < 0) scrollpane_scroll = 0; - + int bottom = (int) scrollpane_text.size() - scrollpane_scroll; int current_line = 0; @@ -100,8 +100,8 @@ void ScrollPane::draw() } // new word, wrap if necessary - else if ((*c == '\n' ) || ( *c == ' ')) { - + else if ((*c == '\n') || (*c == ' ')) { + if (line_length + word_length > (size_t) text_width) { if (line.size()) { lines.push_back(line); @@ -111,33 +111,33 @@ void ScrollPane::draw() line_length = 0; } } - + line.append(word); line_length += word_length; word.clear(); word_length = 0; wordpen = pen; - + // new line - if (*c == '\n' ) { + if (*c == '\n') { lines.push_back(line); line.clear(); line_length = 0; pen = 'N'; wordpen = 'N'; - // new word - } else if (*c == ' ' ) { + // new word + } else if (*c == ' ') { line += ' '; line_length++; } } // new character - else { + else { word += *c; word_length++; - + if (word_length == (size_t) text_width) { if (line.size()) { lines.push_back(line); @@ -158,15 +158,15 @@ void ScrollPane::draw() c++; } - + } - current_line++; + current_line++; } gl::color(palette()->text()); const math ::Vector2f gl(global_location()); float y = 0; - + if ((alignment() & AlignTop) == AlignTop) { int i = (int) lines.size(); for (ui::Text::iterator it = lines.begin(); it != lines.end(); it++) { -- cgit v1.2.3