本文整理汇总了C++中oobase::SharedPtr::on_cursormove方法的典型用法代码示例。如果您正苦于以下问题:C++ SharedPtr::on_cursormove方法的具体用法?C++ SharedPtr::on_cursormove怎么用?C++ SharedPtr::on_cursormove使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类oobase::SharedPtr
的用法示例。
在下文中一共展示了SharedPtr::on_cursormove方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: size
bool Indigo::Render::UILayer::on_cursormove(const glm::dvec2& pos)
{
if (!visible())
return false;
const glm::uvec2& sz = size();
glm::ivec2 ipos = glm::clamp(glm::ivec2(glm::floor(pos)),glm::ivec2(0),glm::ivec2(sz.x-1,sz.y-1));
OOBase::Vector<OOBase::WeakPtr<UIDrawable>,OOBase::ThreadLocalAllocator> hits;
hit_test(hits,ipos);
for (OOBase::Vector<OOBase::WeakPtr<UIDrawable>,OOBase::ThreadLocalAllocator>::iterator i=m_cursor_hits.begin();i;)
{
if (hits.find(*i))
++i;
else
{
OOBase::SharedPtr<UIDrawable> d = i->lock();
i = m_cursor_hits.erase(i);
if (d && d->on_cursorenter(false))
break;
}
}
for (OOBase::Vector<OOBase::WeakPtr<UIDrawable>,OOBase::ThreadLocalAllocator>::iterator i=hits.begin();i;++i)
{
if (m_cursor_hits.remove(*i) == 0)
{
OOBase::SharedPtr<UIDrawable> d = i->lock();
if (d && d->on_cursorenter(true))
break;
}
}
m_cursor_hits.swap(hits);
bool handled = false;
for (OOBase::Vector<OOBase::WeakPtr<UIDrawable>,OOBase::ThreadLocalAllocator>::iterator i=m_cursor_hits.begin();!handled && i;)
{
OOBase::SharedPtr<UIDrawable> d = i->lock();
if (!d)
m_cursor_hits.erase(i);
else
{
handled = d->on_cursormove();
++i;
}
}
return m_owner->m_modal || handled;
}