diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2021-02-07 14:39:53 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2021-02-13 13:02:54 -0800 |
commit | 91d371374b618ea6a173dcd94f9f11b2e96b85ce (patch) | |
tree | fabc575da16b684aa2b559cd36ae198e5319f03a /stats/chartitem.cpp | |
parent | 06a091643e63e4c0eb1d3bda61871be1b44b93a9 (diff) | |
download | subsurface-91d371374b618ea6a173dcd94f9f11b2e96b85ce.tar.gz |
statistics: remove horizontal flag from bar chart items
This flag existed for historical reasons: The base of bar items
had no line and therefore the lines had to be draw differently
for horizontal (base to the left) and vertical (base on the bottom)
item.
This did not work properly and therefore has been removed. Thus,
the flag became pointless.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'stats/chartitem.cpp')
-rw-r--r-- | stats/chartitem.cpp | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/stats/chartitem.cpp b/stats/chartitem.cpp index 5aa45be13..1a93de0c9 100644 --- a/stats/chartitem.cpp +++ b/stats/chartitem.cpp @@ -402,8 +402,8 @@ void ChartRectLineItem::render() positionDirty = materialDirty = false; } -ChartBarItem::ChartBarItem(StatsView &v, ChartZValue z, double borderWidth, bool horizontal) : HideableChartItem(v, z), - borderWidth(borderWidth), selected(false), horizontal(horizontal), +ChartBarItem::ChartBarItem(StatsView &v, ChartZValue z, double borderWidth) : HideableChartItem(v, z), + borderWidth(borderWidth), selected(false), positionDirty(false), colorDirty(false), selectedDirty(false) { } @@ -453,17 +453,10 @@ void ChartBarItem::render() if (positionDirty) { node->node->setRect(rect); auto vertices = borderGeometry->vertexDataAsPoint2D(); - if (horizontal) { - setPoint(vertices[0], rect.topLeft()); - setPoint(vertices[1], rect.topRight()); - setPoint(vertices[2], rect.bottomRight()); - setPoint(vertices[3], rect.bottomLeft()); - } else { - setPoint(vertices[0], rect.bottomLeft()); - setPoint(vertices[1], rect.topLeft()); - setPoint(vertices[2], rect.topRight()); - setPoint(vertices[3], rect.bottomRight()); - } + setPoint(vertices[0], rect.topLeft()); + setPoint(vertices[1], rect.topRight()); + setPoint(vertices[2], rect.bottomRight()); + setPoint(vertices[3], rect.bottomLeft()); node->node->markDirty(QSGNode::DirtyGeometry); borderNode->markDirty(QSGNode::DirtyGeometry); } @@ -540,7 +533,7 @@ QRectF ChartBarItem::getRect() const } ChartBoxItem::ChartBoxItem(StatsView &v, ChartZValue z, double borderWidth) : - ChartBarItem(v, z, borderWidth, false) // Only support for vertical boxes + ChartBarItem(v, z, borderWidth) { } |