complete left click event handle

This commit is contained in:
2017-02-09 22:08:30 +00:00
parent de1784e932
commit 914fc34331
8 changed files with 140 additions and 11 deletions

View File

@@ -173,13 +173,16 @@ void App::update(float dt)
if (layout.reload())
{
layout[main_id].update(width, height);
//Node* check = layout[main_id].find("check");
//if (check)
// check->m_display = false;
}
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
glEnable(GL_SCISSOR_TEST);
for (auto& n : layout[main_id])
{
if (n.m_widget)
if (n.m_display && n.m_widget)
{
auto box = n.m_widget->clip;
glScissor((int)box.x, (int)(height - box.y - box.w), (int)box.z, (int)box.w);
@@ -225,7 +228,11 @@ void App::resize(float w, float h)
void App::mouse_down(int button, float x, float y)
{
constexpr auto main_id = const_hash("main");
printf("mouse click %f %f\n", x, y);
MouseEvent e;
e.m_pos = { x, y };
layout[main_id].on_event(&e);
}
void App::mouse_move(float x, float y)
{