[apps] Rename methods in curve view with banner

Change-Id: I676ea90c241de1ade692fa04ee9c1daa89f3480f
This commit is contained in:
Émilie Feral
2016-12-28 13:50:37 +01:00
parent 77b4187888
commit 852a6146e8
8 changed files with 37 additions and 43 deletions

View File

@@ -11,23 +11,20 @@ HistogramView::HistogramView(Data * data) :
{
}
void HistogramView::reloadMainView() {
reload(m_data->selectedBar());
void HistogramView::reloadSelection() {
float pixelLowerBound = floatToPixel(Axis::Horizontal, m_data->selectedBar() - m_data->barWidth())-1;
float pixelUpperBound = floatToPixel(Axis::Horizontal, m_data->selectedBar() + m_data->barWidth())+1;
float selectedValueInPixels = floatToPixel(Axis::Vertical, (float)m_data->heightForBarAtValue(m_data->selectedBar())/(float)m_data->totalSize())-1;
float horizontalAxisInPixels = floatToPixel(Axis::Vertical, 0.0f)+1;
KDRect dirtyZone(KDRect(pixelLowerBound, selectedValueInPixels, pixelUpperBound-pixelLowerBound,
horizontalAxisInPixels - selectedValueInPixels));
markRectAsDirty(dirtyZone);
m_bannerView.reload();
}
void HistogramView::reload(float dirtyZoneCenter) {
if (isnan(dirtyZoneCenter)) {
markRectAsDirty(bounds());
computeLabels(Axis::Horizontal);
} else {
float pixelLowerBound = floatToPixel(Axis::Horizontal, dirtyZoneCenter - m_data->barWidth())-1;
float pixelUpperBound = floatToPixel(Axis::Horizontal, dirtyZoneCenter + m_data->barWidth())+1;
float selectedValueInPixels = floatToPixel(Axis::Vertical, (float)m_data->heightForBarAtValue(dirtyZoneCenter)/(float)m_data->totalSize())-1;
float horizontalAxisInPixels = floatToPixel(Axis::Vertical, 0.0f)+1;
KDRect dirtyZone(KDRect(pixelLowerBound, selectedValueInPixels, pixelUpperBound-pixelLowerBound,
horizontalAxisInPixels - selectedValueInPixels));
markRectAsDirty(dirtyZone);
}
void HistogramView::reload() {
markRectAsDirty(bounds());
computeLabels(Axis::Horizontal);
m_bannerView.reload();
}