summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDimitrios Apostolou <jimis@qt.io>2021-08-17 12:18:23 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-08-19 13:26:18 +0000
commit5e97554bdd41d7bbdf4c5386cd0ccdb3d4d519ff (patch)
tree61d8d9f8d73562541be0e12e189c6e05c9a471b7 /src
parentc8d5791d8a9fd0a482908762b12e85af1ba2a4f1 (diff)
Revert "Fix X axis labels to not draw over each other"
This reverts commit 5b6e1042bd0aa4514df71209e7784b23490dbd1e. It is reverted because it caused QTBUG-94998 (missing labels at the edges of axis). This revert reintroduces QTBUG-79218 (axis labels drawing over each other). A followup patch will fix it differently. Fixes: QTBUG-94998 Task-number: QTBUG-79218 Change-Id: I0dbb7e0a345feb9986bcf5d1d3e24d8dbea2277b Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io> (cherry picked from commit 4b056cf30d5870f73ec467a963fcaaa6ec6fab46) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r--src/charts/layout/cartesianchartlayout.cpp16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/charts/layout/cartesianchartlayout.cpp b/src/charts/layout/cartesianchartlayout.cpp
index 355a7605..af22b93d 100644
--- a/src/charts/layout/cartesianchartlayout.cpp
+++ b/src/charts/layout/cartesianchartlayout.cpp
@@ -193,18 +193,14 @@ QRectF CartesianChartLayout::calculateAxisGeometry(const QRectF &geometry,
if (leftSqueezeRatio < 1.0)
width *= leftSqueezeRatio;
leftOffset+=width;
- axis->setGeometry(QRect(chartRect.left() - leftOffset, chartRect.top(),
- width, chartRect.bottom()),
- chartRect);
+ axis->setGeometry(QRect(chartRect.left()-leftOffset, geometry.top(),width, geometry.bottom()),chartRect);
break;
}
case Qt::AlignRight:{
qreal width = size.width();
if (rightSqueezeRatio < 1.0)
width *= rightSqueezeRatio;
- axis->setGeometry(QRect(chartRect.right() + rightOffset, chartRect.top(),
- width, chartRect.bottom()),
- chartRect);
+ axis->setGeometry(QRect(chartRect.right()+rightOffset,geometry.top(),width,geometry.bottom()),chartRect);
rightOffset+=width;
break;
}
@@ -212,9 +208,7 @@ QRectF CartesianChartLayout::calculateAxisGeometry(const QRectF &geometry,
qreal height = size.height();
if (topSqueezeRatio < 1.0)
height *= topSqueezeRatio;
- axis->setGeometry(QRect(chartRect.left(), chartRect.top() - topOffset - height,
- chartRect.width(), height),
- chartRect);
+ axis->setGeometry(QRect(geometry.left(), chartRect.top() - topOffset - height, geometry.width(), height), chartRect);
topOffset += height;
break;
}
@@ -222,9 +216,7 @@ QRectF CartesianChartLayout::calculateAxisGeometry(const QRectF &geometry,
qreal height = size.height();
if (bottomSqueezeRatio < 1.0)
height *= bottomSqueezeRatio;
- axis->setGeometry(QRect(chartRect.left(), chartRect.bottom() + bottomOffset,
- chartRect.width(), height),
- chartRect);
+ axis->setGeometry(QRect(geometry.left(), chartRect.bottom() + bottomOffset, geometry.width(), height), chartRect);
bottomOffset += height;
break;
}