Removed selection of last enabled part on pie chart.
This commit is contained in:
parent
83753343cb
commit
5dc078a3f8
|
@ -431,6 +431,7 @@ void StackLinearChartView::paintZoomed(QPainter &p, const PaintContext &c) {
|
||||||
|
|
||||||
auto hq = PainterHighQualityEnabler(p);
|
auto hq = PainterHighQualityEnabler(p);
|
||||||
auto selectedLineIndex = -1;
|
auto selectedLineIndex = -1;
|
||||||
|
const auto skipTranslation = skipSelectedTranslation();
|
||||||
for (auto k = 0; k < c.chartData.lines.size(); k++) {
|
for (auto k = 0; k < c.chartData.lines.size(); k++) {
|
||||||
const auto previous = k
|
const auto previous = k
|
||||||
? _cachedTransition.lines[k - 1].angle
|
? _cachedTransition.lines[k - 1].angle
|
||||||
|
@ -442,7 +443,9 @@ void StackLinearChartView::paintZoomed(QPainter &p, const PaintContext &c) {
|
||||||
p.setPen(Qt::NoPen);
|
p.setPen(Qt::NoPen);
|
||||||
const auto textAngle = (previous + kPieAngleOffset)
|
const auto textAngle = (previous + kPieAngleOffset)
|
||||||
+ (now - previous) / 2.;
|
+ (now - previous) / 2.;
|
||||||
const auto partOffset = _piePartController.offset(line.id, textAngle);
|
const auto partOffset = skipTranslation
|
||||||
|
? QPointF()
|
||||||
|
: _piePartController.offset(line.id, textAngle);
|
||||||
p.translate(partOffset);
|
p.translate(partOffset);
|
||||||
p.drawPie(
|
p.drawPie(
|
||||||
rectF,
|
rectF,
|
||||||
|
@ -482,6 +485,7 @@ void StackLinearChartView::paintPieText(QPainter &p, const PaintContext &c) {
|
||||||
p.setPen(st::premiumButtonFg);
|
p.setPen(st::premiumButtonFg);
|
||||||
p.setFont(font);
|
p.setFont(font);
|
||||||
const auto opacity = p.opacity();
|
const auto opacity = p.opacity();
|
||||||
|
const auto skipTranslation = skipSelectedTranslation();
|
||||||
for (auto k = 0; k < c.chartData.lines.size(); k++) {
|
for (auto k = 0; k < c.chartData.lines.size(); k++) {
|
||||||
const auto previous = k
|
const auto previous = k
|
||||||
? _cachedTransition.lines[k - 1].angle
|
? _cachedTransition.lines[k - 1].angle
|
||||||
|
@ -506,9 +510,9 @@ void StackLinearChartView::paintPieText(QPainter &p, const PaintContext &c) {
|
||||||
const auto textRect = QRectF(
|
const auto textRect = QRectF(
|
||||||
textRectCenter - QPointF(textXShift, textYShift),
|
textRectCenter - QPointF(textXShift, textYShift),
|
||||||
textRectCenter + QPointF(textXShift, textYShift));
|
textRectCenter + QPointF(textXShift, textYShift));
|
||||||
const auto partOffset = _piePartController.offset(
|
const auto partOffset = skipTranslation
|
||||||
c.chartData.lines[k].id,
|
? QPointF()
|
||||||
textAngle);
|
: _piePartController.offset(c.chartData.lines[k].id, textAngle);
|
||||||
p.setTransform(
|
p.setTransform(
|
||||||
QTransform()
|
QTransform()
|
||||||
.translate(
|
.translate(
|
||||||
|
@ -604,6 +608,10 @@ void StackLinearChartView::handleMouseMove(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool StackLinearChartView::skipSelectedTranslation() const {
|
||||||
|
return (_entries.size() == (_cachedTransition.lines.size() - 1));
|
||||||
|
}
|
||||||
|
|
||||||
void StackLinearChartView::paintSelectedXIndex(
|
void StackLinearChartView::paintSelectedXIndex(
|
||||||
QPainter &p,
|
QPainter &p,
|
||||||
const Data::StatisticalChart &chartData,
|
const Data::StatisticalChart &chartData,
|
||||||
|
|
|
@ -88,6 +88,8 @@ private:
|
||||||
void paintZoomed(QPainter &p, const PaintContext &context);
|
void paintZoomed(QPainter &p, const PaintContext &context);
|
||||||
void paintPieText(QPainter &p, const PaintContext &context);
|
void paintPieText(QPainter &p, const PaintContext &context);
|
||||||
|
|
||||||
|
[[nodiscard]] bool skipSelectedTranslation() const;
|
||||||
|
|
||||||
struct SelectedPoints final {
|
struct SelectedPoints final {
|
||||||
int lastXIndex = -1;
|
int lastXIndex = -1;
|
||||||
Limits lastHeightLimits;
|
Limits lastHeightLimits;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user