diff --git a/applications/gui2/src/views/camera.cpp b/applications/gui2/src/views/camera.cpp index 004b1f854c5a8fc85e2ac063e53951d519ba018d..16b0094821fc81943db1bc4abddf809585015310 100644 --- a/applications/gui2/src/views/camera.cpp +++ b/applications/gui2/src/views/camera.cpp @@ -138,9 +138,11 @@ CameraView::~CameraView() { bool CameraView::mouseButtonEvent(const Eigen::Vector2i &p, int button, bool down, int modifiers) { //LOG(INFO) << "mouseButtonEvent: " << p << " - " << button; - if (button == 0) { - // FIXME: Allow for zoom and offset of image... - ctrl_->touch(0, ftl::codecs::TouchType::MOUSE_LEFT, p.x()-mPos.x(), p.y()-mPos.y(), 0.0f); + if (button == 0 && !down) { + auto pos = imview_->imageCoordinateAt((p - mPos).cast<float>()); + if (pos.x() >= 0.0f && pos.y() >= 0.0f) { + ctrl_->touch(0, ftl::codecs::TouchType::MOUSE_LEFT, pos.x(), pos.y(), 0.0f); + } return true; } return false;