Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/input.cc')
-rw-r--r--src/ui/input.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ui/input.cc b/src/ui/input.cc
index 5e000d2..8113354 100644
--- a/src/ui/input.cc
+++ b/src/ui/input.cc
@@ -8,7 +8,6 @@
#include "ui/paint.h"
#include "auxiliary/functions.h"
#include "core/core.h"
-#include "render/render.h"
namespace ui
{
@@ -52,7 +51,7 @@ void Input::draw()
draw_background();
draw_border();
- size_t text_width = (size_t) width() / font()->width();
+ size_t text_width = (size_t) floorf(width() / font()->width());
math::Vector2f v(global_location());
paint::color(palette()->foreground());
@@ -74,7 +73,7 @@ void Input::draw()
while (*c && draw_width > text_width - 2) {
if (aux::is_color_code(c)) {
c++;
- render::Text::setcolor(*c);
+ paint::color_code(*c);
} else {
draw_width--;
}
@@ -89,7 +88,7 @@ void Input::draw()
v.x += draw_width * font()->width();
if (input_pos < input_text.size()) {
if (input_pos > 1 && aux::is_color_code(input_text.c_str() + input_pos -1)) {
- render::Text::setcolor(input_text[input_pos]);
+ paint::color_code(input_text[input_pos]);
}
// limit to width
std::string secondpart;
@@ -119,6 +118,7 @@ bool Input::on_keypress(const int key, const unsigned int modifier)
{
switch (key) {
case SDLK_TAB:
+ // FIXME should not be here
core::CommandBuffer::complete(input_text, input_pos);
return true;
break;