29 visionx::ImageViewerArea(parent)
35 int clickedX = ev->x();
36 int clickedY = ev->y();
41 if (clickedX < 0 || clickedX > dimensions.x
42 || clickedY < 0 || clickedY > dimensions.y)
48 float relX =
std::min(
float(clickedX), dimensions.x - 1);
49 float relY =
std::min(
float(clickedY), dimensions.y - 1);
57 int imageIndex = int(relX * numberImages);
60 relX -=
float(imageIndex) / numberImages;
68 emit
selected(imageIndex, relX, relY);