This commit is contained in:
Vladislav Khorev 2013-06-13 20:42:11 +00:00
parent 9195096bcb
commit e9de663388
2 changed files with 5 additions and 0 deletions

View File

@ -11,6 +11,7 @@ Use global variable Console like that:
#include <iostream> #include <iostream>
#include <string> #include <string>
#include <vector>
#ifdef TARGET_WIN32 #ifdef TARGET_WIN32
#include <fstream> #include <fstream>

View File

@ -131,6 +131,8 @@ namespace SE
bool TKeyboardWidget::CheckClick(vec2 mousePos) bool TKeyboardWidget::CheckClick(vec2 mousePos)
{ {
mousePos -= LeftBottomPos;
return (mousePos.v[0] >= 0.f && mousePos.v[1] >= 0.f && mousePos.v[0] <= 320.f && mousePos.v[1] <= 216.f); return (mousePos.v[0] >= 0.f && mousePos.v[1] >= 0.f && mousePos.v[0] <= 320.f && mousePos.v[1] <= 216.f);
} }
@ -140,6 +142,8 @@ namespace SE
void TKeyboardWidget::OnTapUp(vec2 pos) void TKeyboardWidget::OnTapUp(vec2 pos)
{ {
pos -= LeftBottomPos;
BOOST_FOREACH(auto& visualKeyElement, VisualKeyArr) BOOST_FOREACH(auto& visualKeyElement, VisualKeyArr)
{ {
if (std::get<0>(visualKeyElement).CheckClicked(ivec2(pos.v[0], pos.v[1]))) if (std::get<0>(visualKeyElement).CheckClicked(ivec2(pos.v[0], pos.v[1])))