This commit is contained in:
furrtek
2016-05-09 21:05:11 +02:00
parent 8523bd860e
commit 569f299f42
57 changed files with 1155 additions and 772 deletions
+2 -1
View File
@@ -114,6 +114,7 @@ void FrequencyScale::draw_frequency_ticks(Painter& painter, const Rect r) {
(magnitude_n >= 6) ? "M" :
(magnitude_n >= 3) ? "k" : "";
const std::string label = to_string_dec_uint(tick_offset) + zero_pad + unit;
const auto label_width = style().font.size_of(label).w;
const Coord offset_low = r.left() + x_center - pixel_offset;
const Rect tick_low { offset_low, r.top(), 1, r.height() };
@@ -123,7 +124,7 @@ void FrequencyScale::draw_frequency_ticks(Painter& painter, const Rect r) {
const Coord offset_high = r.left() + x_center + pixel_offset;
const Rect tick_high { offset_high, r.top(), 1, r.height() };
painter.fill_rectangle(tick_high, Color::white());
painter.draw_string({ offset_high + 2, r.top() }, style(), label );
painter.draw_string({ offset_high - 2 - label_width, r.top() }, style(), label );
tick_offset += tick_interval;
}