Merge lp:~nomeata/widelands/976077 into lp:widelands

Proposed by Joachim Breitner
Status: Merged
Merged at revision: 6436
Proposed branch: lp:~nomeata/widelands/976077
Merge into: lp:widelands
Diff against target: 65 lines (+9/-5)
2 files modified
src/wui/plot_area.cc (+8/-5)
src/wui/plot_area.h (+1/-0)
To merge this branch: bzr merge lp:~nomeata/widelands/976077
Reviewer Review Type Date Requested Status
Widelands Developers Pending
Review via email: mp+131729@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/wui/plot_area.cc'
--- src/wui/plot_area.cc 2012-09-21 21:36:07 +0000
+++ src/wui/plot_area.cc 2012-10-27 12:01:23 +0000
@@ -57,7 +57,8 @@
57UI::Panel (parent, x, y, w, h),57UI::Panel (parent, x, y, w, h),
58spacing(5),58spacing(5),
59space_at_bottom(15),59space_at_bottom(15),
60space_at_right(5),60space_at_right(10),
61space_left_of_label(15),
61m_time (TIME_GAME),62m_time (TIME_GAME),
62m_sample_rate(0),63m_sample_rate(0),
63m_plotmode(PLOTMODE_ABSOLUTE),64m_plotmode(PLOTMODE_ABSOLUTE),
@@ -212,7 +213,7 @@
212213
213 // plot the pixels214 // plot the pixels
214 float sub =215 float sub =
215 xline_length216 (xline_length - space_left_of_label)
216 /217 /
217 (static_cast<float>(time_in_ms_)218 (static_cast<float>(time_in_ms_)
218 /219 /
@@ -237,7 +238,7 @@
237 }238 }
238239
239 dataset = &m_data;240 dataset = &m_data;
240 sub = xline_length / static_cast<float>(nr_samples);241 sub = (xline_length - space_left_of_label) / static_cast<float>(nr_samples);
241 }242 }
242243
243 draw_plot_line244 draw_plot_line
@@ -380,7 +381,7 @@
380 UI::TextStyle xtickstyle(UI::TextStyle::ui_small());381 UI::TextStyle xtickstyle(UI::TextStyle::ui_small());
381 xtickstyle.fg = RGBColor(255, 0, 0);382 xtickstyle.fg = RGBColor(255, 0, 0);
382383
383 float sub = xline_length / how_many_ticks;384 float sub = (xline_length - space_left_of_label) / how_many_ticks;
384 float posx = get_inner_w() - space_at_right;385 float posx = get_inner_w() - space_at_right;
385386
386 for (uint32_t i = 0; i <= how_many_ticks; ++i) {387 for (uint32_t i = 0; i <= how_many_ticks; ++i) {
@@ -389,9 +390,11 @@
389 static_cast<int32_t>(posx), get_inner_h() - space_at_bottom + 3,390 static_cast<int32_t>(posx), get_inner_h() - space_at_bottom + 3,
390 LINE_COLOR, 2);391 LINE_COLOR, 2);
391392
393 // The space at the end is intentional to have the tick centered
394 // over the number, not to the left
392 snprintf395 snprintf
393 (buffer, sizeof(buffer),396 (buffer, sizeof(buffer),
394 "%u", max_x / how_many_ticks * i);397 "-%u ", max_x / how_many_ticks * i);
395398
396 UI::g_fh->draw_text399 UI::g_fh->draw_text
397 (dst, xtickstyle,400 (dst, xtickstyle,
398401
=== modified file 'src/wui/plot_area.h'
--- src/wui/plot_area.h 2012-02-15 21:25:34 +0000
+++ src/wui/plot_area.h 2012-10-27 12:01:23 +0000
@@ -107,6 +107,7 @@
107 int32_t const spacing;107 int32_t const spacing;
108 int32_t const space_at_bottom;108 int32_t const space_at_bottom;
109 int32_t const space_at_right;109 int32_t const space_at_right;
110 int32_t const space_left_of_label;
110111
111 static const uint32_t time_in_ms[];112 static const uint32_t time_in_ms[];
112 static const uint32_t nr_samples = 30; // How many samples per diagramm when relative plotting113 static const uint32_t nr_samples = 30; // How many samples per diagramm when relative plotting

Subscribers

People subscribed via source and target branches

to status/vote changes: