summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorDyami Caliri <dyami@dragonframe.com>2015-01-26 14:45:09 -0800
committerDyami Caliri <dyami@dragonframe.com>2015-02-02 21:38:23 +0000
commit2a27fc41a418cc3fda26334fdbaf1e31c9eecce5 (patch)
treef80251fc034fc2435759b4ea4166bf2b8cdd4ee0 /src/widgets
parent2b9949169273efa0c918a168c340aa0d837911fb (diff)
Fix QGraphicsWidget window frame section logic
CppCat detected duplicate sub-expressions in the code that checked for BottomLeftSection and BottomRightSection. It was fairly obvious to see what the values should be. Change-Id: Id45ca5bbd26c92b800c60867fef5170578216eee Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/graphicsview/qgraphicswidget.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/widgets/graphicsview/qgraphicswidget.cpp b/src/widgets/graphicsview/qgraphicswidget.cpp
index 5bd563e535..98e011ff05 100644
--- a/src/widgets/graphicsview/qgraphicswidget.cpp
+++ b/src/widgets/graphicsview/qgraphicswidget.cpp
@@ -1311,7 +1311,7 @@ Qt::WindowFrameSection QGraphicsWidget::windowFrameSectionAt(const QPointF &pos)
if (x <= left + cornerMargin) {
if (y <= top + windowFrameWidth || (x <= left + windowFrameWidth && y <= top + cornerMargin)) {
s = Qt::TopLeftSection;
- } else if (y >= bottom - windowFrameWidth || (x <= left + windowFrameWidth && y >= bottom - windowFrameWidth)) {
+ } else if (y >= bottom - windowFrameWidth || (x <= left + windowFrameWidth && y >= bottom - cornerMargin)) {
s = Qt::BottomLeftSection;
} else if (x <= left + windowFrameWidth) {
s = Qt::LeftSection;
@@ -1319,7 +1319,7 @@ Qt::WindowFrameSection QGraphicsWidget::windowFrameSectionAt(const QPointF &pos)
} else if (x >= right - cornerMargin) {
if (y <= top + windowFrameWidth || (x >= right - windowFrameWidth && y <= top + cornerMargin)) {
s = Qt::TopRightSection;
- } else if (y >= bottom - windowFrameWidth || (x >= right - windowFrameWidth && y >= bottom - windowFrameWidth)) {
+ } else if (y >= bottom - windowFrameWidth || (x >= right - windowFrameWidth && y >= bottom - cornerMargin)) {
s = Qt::BottomRightSection;
} else if (x >= right - windowFrameWidth) {
s = Qt::RightSection;