blob: f534de0a5bdda8b2a64425cbb2f867137a48376a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
#pragma once
#include "drape_frontend/animation/show_hide_animation.hpp"
#include <string>
class ScreenBase;
namespace gui
{
class RulerHelper
{
public:
RulerHelper();
void Update(ScreenBase const & screen);
bool IsVisible(ScreenBase const & screen) const;
void Invalidate();
float GetRulerHalfHeight() const;
float GetRulerPixelLength() const;
float GetMaxRulerPixelLength() const;
int GetVerticalTextOffset() const;
bool IsTextDirty() const;
std::string const & GetRulerText() const;
void ResetTextDirtyFlag();
void GetTextInitInfo(std::string & alphabet, uint32_t & size) const;
private:
double CalcMetersDiff(double value);
void SetTextDirty();
private:
float m_pixelLength;
int m_rangeIndex;
std::string m_rulerText;
bool m_isTextDirty;
mutable bool m_dirtyTextRequested;
int m_currentDrawScale = 0;
};
} // namespace gui
|