Commit 3b4662fe authored by Anthony Léonard's avatar Anthony Léonard

Fix area selection for screen sharing

If the selection area wasn't dragged from top left to
bottom right, the area wasn't displayed and the selection
was failing by sharing the entire screen. This patch fix
this issue so the area can be selected in any direction.

Change-Id: Ie3bb0225a926761769c8db43b1ca83bf9b410d8a
Tuleap: #1173
parent adc81f09
......@@ -69,8 +69,13 @@ SelectAreaDialog::mousePressEvent(QMouseEvent* event)
void
SelectAreaDialog::mouseMoveEvent(QMouseEvent* event)
{
int top = std::min(event->globalY(), origin_.y());
int left = std::min(event->globalX(), origin_.x());
int bottom = std::max(event->globalY(), origin_.y());
int right = std::max(event->globalX(), origin_.x());
if (rubberBand_)
rubberBand_->setGeometry(QRect(origin_, event->globalPos()));
rubberBand_->setGeometry(QRect(QPoint(left,top), QPoint(right,bottom)));
}
void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment