예제 #1
0
ObjMapObject
ObjectLayer::find_object(const CL_Pointf& click_pos)
{
  for(Objects::reverse_iterator i = impl->objects.rbegin(); i != impl->objects.rend(); ++i)
  {
    CL_Rectf rect = (*i).get_bound_rect();

    if (rect.is_inside(CL_Point(click_pos)))
      return *i;
  }
  return ObjMapObject();
}
예제 #2
0
ObjectLayer::Objects
ObjectLayer::get_selection(const CL_Rectf& rect)
{
  Objects selection;

  for(Objects::iterator i = impl->objects.begin(); i != impl->objects.end(); ++i)
  {
    // FIXME:
    if (rect.is_inside((*i).get_pos()))
    {
      selection.push_back(*i);
    }
  }

  return selection;
}