fix mouse position calculate incorrect

Change-Id: I38673c87d1ce32906a5770a3459019c2e525d8ff
This commit is contained in:
石博文 2017-09-26 15:59:27 +08:00
parent 3e6920f447
commit 5764015655
Notes: Deepin Code Review 2017-09-26 16:16:42 +08:00
Verified+1: Anonymous Coward #1000004
Code-Review+2: 石博文 <sbw@sbw.so>
Submitted-by: 石博文 <sbw@sbw.so>
Submitted-at: Tue, 26 Sep 2017 16:16:42 +0800
Reviewed-on: https://cr.deepin.io/26661
Project: dde/dde-dock
Branch: refs/heads/master
2 changed files with 3 additions and 2 deletions

View File

@ -46,7 +46,7 @@ DockItem::DockItem(QWidget *parent)
arrowRectangle->setShadowBlurRadius(20);
// arrowRectangle->setBorderWidth(0);
arrowRectangle->setRadius(6);
arrowRectangle->setShadowDistance(0);
// arrowRectangle->setShadowDistance(0);
arrowRectangle->setShadowYOffset(2);
arrowRectangle->setShadowXOffset(0);
arrowRectangle->setArrowWidth(18);

View File

@ -159,8 +159,9 @@ void DockPopupWindow::globalMouseRelease(int button, int x, int y, const QString
Q_ASSERT(m_model);
const auto ratio = devicePixelRatioF();
const QRect rect = QRect(pos(), size());
const QPoint pos = QPoint(x, y);
const QPoint pos = QPoint(x / ratio, y / ratio);
if (rect.contains(pos))
return;