frts::ComponentPtr frts::DropBuilder::build(const EntityPtr&, const SharedManagerPtr& shared) { assert(shared != nullptr); auto id = shared->makeId(ComponentIds::drop()); return makeDrop(id); }
void ImageDisplay::mouseReleaseEvent ( QMouseEvent* event ) { QGLWidget::mouseReleaseEvent ( event ); makeDrop ( event->x(), event->y() ); float left = dragX * ( image->width() / ( float ) width() ); float right = dropX * ( image->width() / ( float ) width() ); float top = dragY * ( image->height() / ( float ) height() ); float bottom = dropY * ( image->height() / ( float ) height() ); if ( left > right ) { std::swap ( left, right ); } if ( top > bottom ) { std::swap ( top, bottom ); } emit rectSelect ( left, top, right, bottom ); }