complete left click event handle
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user