diff --git a/jsk_rqt_plugins/src/jsk_rqt_plugins/image_view2_wrapper.py b/jsk_rqt_plugins/src/jsk_rqt_plugins/image_view2_wrapper.py index b82157c9..b0c79a66 100644 --- a/jsk_rqt_plugins/src/jsk_rqt_plugins/image_view2_wrapper.py +++ b/jsk_rqt_plugins/src/jsk_rqt_plugins/image_view2_wrapper.py @@ -237,9 +237,11 @@ def mouseMoveEvent(self, e): msg = MouseEvent() msg.header.stamp = rospy.Time.now() msg.type = MouseEvent.MOUSE_MOVE - msg.x, msg.y = self.mousePosition(e) msg.width = self.label.pixmap().width() msg.height = self.label.pixmap().height() + x, y = self.mousePosition(e) + msg.x = int(x) + msg.y = int(y) if self.event_pub: self.event_pub.publish(msg) @@ -253,7 +255,9 @@ def mousePressEvent(self, e): msg.type = MouseEvent.MOUSE_RIGHT_DOWN msg.width = self.label.pixmap().width() msg.height = self.label.pixmap().height() - msg.x, msg.y = self.mousePosition(e) + x, y = self.mousePosition(e) + msg.x = int(x) + msg.y = int(y) if self.event_pub: self.event_pub.publish(msg) @@ -265,7 +269,9 @@ def mouseReleaseEvent(self, e): msg.width = self.label.pixmap().width() msg.height = self.label.pixmap().height() msg.type = MouseEvent.MOUSE_LEFT_UP - msg.x, msg.y = self.mousePosition(e) + x, y = self.mousePosition(e) + msg.x = int(x) + msg.y = int(y) if self.event_pub: self.event_pub.publish(msg)