Skip to content

Commit

Permalink
Drop have_dimensions_ member
Browse files Browse the repository at this point in the history
  • Loading branch information
rhaschke committed Apr 25, 2024
1 parent 1a48217 commit 8469d18
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
5 changes: 2 additions & 3 deletions src/rviz/image/mouse_click.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ namespace rviz
{
MouseClick::MouseClick(QWidget* widget, const ros::NodeHandle& nh) : QObject(widget)
{
img_width_ = img_height_ = win_width_ = win_height_ = 0;
node_handle_ = nh;
have_dimensions_ = false;
topic_name_ok_ = false;
widget->installEventFilter(this);
}
Expand All @@ -26,7 +26,7 @@ void MouseClick::disable()

bool MouseClick::eventFilter(QObject* obj, QEvent* event)
{
if (have_dimensions_ && publisher_.operator void*() && event->type() == QEvent::MouseButtonPress)
if (publisher_.operator void*() && event->type() == QEvent::MouseButtonPress)
{
QMouseEvent* me = static_cast<QMouseEvent*>(event);
QPointF windowPos = me->windowPos();
Expand Down Expand Up @@ -75,7 +75,6 @@ void MouseClick::setDimensions(int img_width, int img_height, int win_width, int
img_height_ = img_height;
win_width_ = win_width;
win_height_ = win_height;
have_dimensions_ = true;
}

void MouseClick::setImageTopic(const QString& topic)
Expand Down
1 change: 0 additions & 1 deletion src/rviz/image/mouse_click.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ class RVIZ_EXPORT MouseClick : QObject
private:
virtual bool eventFilter(QObject* obj, QEvent* event);

bool have_dimensions_;
int img_width_, img_height_, win_width_, win_height_; // To assess if the clicks are inside the image.
ros::NodeHandle node_handle_;
ros::Publisher publisher_;
Expand Down

0 comments on commit 8469d18

Please sign in to comment.