mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
2e2019dea7
Most colors were already collected there, but a few were dispersed throughout the source files. For future themeability, move the remaining colors to this common place. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
30 lines
728 B
C++
30 lines
728 B
C++
// SPDX-License-Identifier: GPL-2.0
|
|
#include "quartilemarker.h"
|
|
#include "statscolors.h"
|
|
#include "statsaxis.h"
|
|
#include "zvalues.h"
|
|
|
|
static const double quartileMarkerSize = 15.0;
|
|
|
|
QuartileMarker::QuartileMarker(StatsView &view, double pos, double value, StatsAxis *xAxis, StatsAxis *yAxis) :
|
|
ChartLineItem(view, ChartZValue::ChartFeatures, quartileMarkerColor, 2.0),
|
|
xAxis(xAxis), yAxis(yAxis),
|
|
pos(pos),
|
|
value(value)
|
|
{
|
|
updatePosition();
|
|
}
|
|
|
|
QuartileMarker::~QuartileMarker()
|
|
{
|
|
}
|
|
|
|
void QuartileMarker::updatePosition()
|
|
{
|
|
if (!xAxis || !yAxis)
|
|
return;
|
|
double x = xAxis->toScreen(pos);
|
|
double y = yAxis->toScreen(value);
|
|
setLine(QPointF(x - quartileMarkerSize / 2.0, y),
|
|
QPointF(x + quartileMarkerSize / 2.0, y));
|
|
}
|