mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-07 23:53:58 +02:00
Added minimal size of pie part for text on pie chart view.
This commit is contained in:
parent
be17e2b919
commit
d2578e9e47
1 changed files with 4 additions and 0 deletions
|
@ -629,6 +629,7 @@ void StackLinearChartView::paintZoomedFooter(
|
||||||
}
|
}
|
||||||
|
|
||||||
void StackLinearChartView::paintPieText(QPainter &p, const PaintContext &c) {
|
void StackLinearChartView::paintPieText(QPainter &p, const PaintContext &c) {
|
||||||
|
constexpr auto kMinPercentage = 0.03;
|
||||||
if (_transition.progress == 1.) {
|
if (_transition.progress == 1.) {
|
||||||
savePieTextParts(c);
|
savePieTextParts(c);
|
||||||
}
|
}
|
||||||
|
@ -653,6 +654,9 @@ void StackLinearChartView::paintPieText(QPainter &p, const PaintContext &c) {
|
||||||
: -180;
|
: -180;
|
||||||
const auto now = parts[k].stackedAngle;
|
const auto now = parts[k].stackedAngle;
|
||||||
const auto percentage = parts[k].roundedPercentage;
|
const auto percentage = parts[k].roundedPercentage;
|
||||||
|
if (percentage <= kMinPercentage) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
const auto rText = side * std::sqrt(1. - percentage);
|
const auto rText = side * std::sqrt(1. - percentage);
|
||||||
const auto textAngle = (previous + kPieAngleOffset)
|
const auto textAngle = (previous + kPieAngleOffset)
|
||||||
|
|
Loading…
Add table
Reference in a new issue