26 const double mMin = context.
mMin;
27 const double mMax = context.
mMax;
29 const int mLeft = context.
mLeft;
30 const int mTop = context.
mTop;
31 const int mRight = context.
mRight;
32 const int mBottom = context.
mBottom;
33 const int mLength = context.
mLength;
37 constexpr int spacing = 2;
38 const bool mFlip = context.
mFlip;
43 [
this, &dc, &mFonts, mOrientation, mLabelEdges,
44 mMin, mMax, mLength, mRight, mBottom, &context]
45 (
double value,
double *pos) ->
bool {
48 double max = std::max(mMin, mMax);
49 if ((value <=
min && !mLabelEdges) || value <
min)
51 if ((value >= max && !mLabelEdges) || value > max)
54 int mid = (int)(mLength * ((mMin - value) / (mMin - mMax)) + 0.5);
56 const int iMaxPos = (mOrientation == wxHORIZONTAL) ? mRight : mBottom - 5;
57 if (mid >= 0 && mid < iMaxPos) {
66 if (labelIdx >= outputs.
labels.size())
72 if (!TickAtValue(outputs.
labels[labelIdx].value, &pos))
87 mLeft, mTop, spacing, mFonts.
lead,
91 if (!result.second.text)
95 auto& rect = result.first;
96 outputs.
box.Union(rect);
97 outputs.
labels[labelIdx] = (result.second);
98 return !rect.IsEmpty();
static const CustomUpdaterValue & Instance()
~CustomUpdaterValue() override
bool TickCustom(wxDC &dc, int labelIdx, wxFont font, TickOutputs outputs, const RulerStruct &context) const override
static std::pair< wxRect, Label > MakeTick(RulerUpdater::Label lab, wxDC &dc, wxFont font, std::vector< bool > &bits, int left, int top, int spacing, int lead, bool flip, int orientation)
Holds a msgid for the translation catalog; may also bind format arguments.
std::unique_ptr< Fonts > mpFonts
TranslatableString mUnits
An array of these created by the Updater is used to determine what and where text annotations to the ...
std::optional< TranslatableString > text