Files
Upsilon/apps/statistics/box_axis_view.cpp
Léa Saviot 6e9021ed35 [apps/stats] Fix display one axis only in Box tab
The axis view is now a separate view, so there is no problem of
computing the height of the "axed" box view.
2018-05-29 15:34:49 +02:00

20 lines
516 B
C++

#include "box_axis_view.h"
#include <assert.h>
using namespace Shared;
namespace Statistics {
void BoxAxisView::drawRect(KDContext * ctx, KDRect rect) const {
ctx->fillRect(rect, KDColorWhite);
KDRect lineRect = KDRect(0, k_axisMargin, bounds().width(), 1);
ctx->fillRect(lineRect, KDColorBlack);
drawLabels(ctx, rect, Axis::Horizontal, false, false, true, k_axisMargin);
}
char * BoxAxisView::label(Axis axis, int index) const {
return axis == Axis::Vertical ? nullptr : (char *)m_labels[index];
}
}