mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 06:35:14 +00:00
Added minimal size of pie part for text on pie chart view.
This commit is contained in:
@@ -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)
|
||||||
|
Reference in New Issue
Block a user