[apps/regression] Make graph view inherits from Curve view with banner

and cursor

Change-Id: I3d63eb2b0750ba7c11374bb608347efc2418ccfd
This commit is contained in:
Émilie Feral
2016-12-30 17:26:50 +01:00
parent 1c7be02d3c
commit b0a9d23ce3
2 changed files with 8 additions and 5 deletions

View File

@@ -5,7 +5,7 @@
namespace Regression {
GraphView::GraphView(Data * data) :
CurveViewWithBanner(data, 0.2f, 0.2f, 0.4f, 0.2f),
CurveViewWithBannerAndCursor(data, 0.2f, 0.2f, 0.4f, 0.2f),
m_data(data),
m_bannerView(BannerView(data))
{
@@ -14,8 +14,9 @@ GraphView::GraphView(Data * data) :
void GraphView::reloadSelection() {
float pixelXSelection = roundf(floatToPixel(Axis::Horizontal, m_data->xCursorPosition()));
float pixelYSelection = roundf(floatToPixel(Axis::Vertical, m_data->yCursorPosition()));
KDRect dirtyZone(KDRect(pixelXSelection - k_dotSize/2, pixelYSelection - k_dotSize/2, k_dotSize, k_dotSize));
KDRect dirtyZone(KDRect(pixelXSelection - k_dotSize, pixelYSelection - k_dotSize, 2*k_dotSize, 2*k_dotSize));
markRectAsDirty(dirtyZone);
layoutSubviews();
m_bannerView.reload();
}
@@ -23,6 +24,7 @@ void GraphView::reload() {
markRectAsDirty(bounds());
computeLabels(Axis::Horizontal);
computeLabels(Axis::Vertical);
layoutSubviews();
m_bannerView.reload();
}