| 53 | } |
| 54 | |
| 55 | void Canvas::OnEventMouseButtonPressed(const Nz::EventHandler* /*eventHandler*/, const Nz::WindowEvent::MouseButtonEvent& event) |
| 56 | { |
| 57 | if (m_hoveredWidget != InvalidCanvasIndex) |
| 58 | { |
| 59 | WidgetBox& hoveredWidget = m_widgetBoxes[m_hoveredWidget]; |
| 60 | |
| 61 | int x = static_cast<int>(std::round(event.x - hoveredWidget.box.x)); |
| 62 | int y = static_cast<int>(std::round(event.y - hoveredWidget.box.y)); |
| 63 | |
| 64 | hoveredWidget.widget->OnMouseButtonPress(x, y, event.button); |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | void Canvas::OnEventMouseButtonRelease(const Nz::EventHandler* /*eventHandler*/, const Nz::WindowEvent::MouseButtonEvent & event) |
| 69 | { |
nothing calls this directly
no test coverage detected