Skip to content
Repos

DevPlaceApp

C++ 585 B21 lines Opens in site

Directory Raw Download

#include "screens/post/DoubleTapView.hpp"

#include "screens/post/TapGesture.hpp"
#include "ui/View.hpp"

namespace dp {

void DoubleTapView::onTap(ui::Point) { TapGesture::tap(id_, handlers_); }

void DoubleTapView::hits(ui::Point p, std::vector<ui::View*>& out) {
  if (!frame_.contains(p)) return;
  WrapperView::hits(p, out);
  if (handlers_.any()) out.push_back(this);
}

ui::ViewPtr OnTaps(ui::ViewPtr content, TapHandlers handlers) {
  if (!handlers.any()) return content;
  return std::make_shared<DoubleTapView>(std::move(content), std::move(handlers));
}

}  // namespace dp
32.9ms