Widget *Container::GetWidgetAt(const Point &pos) { if (!Contains(pos)) return 0; for (auto end = m_widgets.rend(), it = m_widgets.rbegin(); it != end; ++it) { const auto widget = *it; const Point relpos = pos - widget->GetPosition() - widget->GetDrawOffset(); if (widget->IsContainer()) { Widget* w = static_cast<Container*>(widget.Get())->GetWidgetAt(relpos); if (w) return w; } else if (widget->Contains(relpos)) return widget.Get(); } return this; }
void MultiLineText::Draw() { m_layout->Draw(GetSize(), GetDrawOffset(), GetContext()->GetScissor()); }
void MultiLineText::Draw() { m_layout->Draw(GetSize(), GetDrawOffset(), GetContext()->GetScissor(), Color(Color::WHITE.r, Color::WHITE.g, Color::WHITE.b, Color::WHITE.a*GetContext()->GetOpacity())); }