diff options
Diffstat (limited to 'Applications/Piano')
-rw-r--r-- | Applications/Piano/KeysWidget.cpp | 10 | ||||
-rw-r--r-- | Applications/Piano/KeysWidget.h | 2 | ||||
-rw-r--r-- | Applications/Piano/RollWidget.cpp | 4 | ||||
-rw-r--r-- | Applications/Piano/SamplerWidget.cpp | 8 | ||||
-rw-r--r-- | Applications/Piano/WaveWidget.cpp | 8 |
5 files changed, 16 insertions, 16 deletions
diff --git a/Applications/Piano/KeysWidget.cpp b/Applications/Piano/KeysWidget.cpp index e757ef57c4..c3428120d6 100644 --- a/Applications/Piano/KeysWidget.cpp +++ b/Applications/Piano/KeysWidget.cpp @@ -179,7 +179,7 @@ void KeysWidget::paint_event(GUI::PaintEvent& event) int x = 0; int i = 0; for (;;) { - Gfx::Rect rect(x, 0, white_key_width, frame_inner_rect().height()); + Gfx::IntRect rect(x, 0, white_key_width, frame_inner_rect().height()); painter.fill_rect(rect, m_key_on[note] ? note_pressed_color : Color::White); painter.draw_rect(rect, Color::Black); if (i < white_key_labels_count) { @@ -201,7 +201,7 @@ void KeysWidget::paint_event(GUI::PaintEvent& event) x = white_key_width - black_key_x_offset; i = 0; for (;;) { - Gfx::Rect rect(x, 0, black_key_width, black_key_height); + Gfx::IntRect rect(x, 0, black_key_width, black_key_height); painter.fill_rect(rect, m_key_on[note] ? note_pressed_color : Color::Black); painter.draw_rect(rect, Color::Black); if (i < black_key_labels_count) { @@ -245,7 +245,7 @@ static inline int note_from_white_keys(int white_keys) return note; } -int KeysWidget::note_for_event_position(const Gfx::Point& a_point) const +int KeysWidget::note_for_event_position(const Gfx::IntPoint& a_point) const { if (!frame_inner_rect().contains(a_point)) return -1; @@ -259,7 +259,7 @@ int KeysWidget::note_for_event_position(const Gfx::Point& a_point) const bool black_key_on_left = note != 0 && key_pattern[(note - 1) % notes_per_octave] == Black; if (black_key_on_left) { int black_key_x = (white_keys * white_key_width) - black_key_x_offset; - Gfx::Rect black_key(black_key_x, 0, black_key_width, black_key_height); + Gfx::IntRect black_key(black_key_x, 0, black_key_width, black_key_height); if (black_key.contains(point)) return note - 1; } @@ -267,7 +267,7 @@ int KeysWidget::note_for_event_position(const Gfx::Point& a_point) const bool black_key_on_right = key_pattern[(note + 1) % notes_per_octave] == Black; if (black_key_on_right) { int black_key_x = ((white_keys + 1) * white_key_width) - black_key_x_offset; - Gfx::Rect black_key(black_key_x, 0, black_key_width, black_key_height); + Gfx::IntRect black_key(black_key_x, 0, black_key_width, black_key_height); if (black_key.contains(point)) return note + 1; } diff --git a/Applications/Piano/KeysWidget.h b/Applications/Piano/KeysWidget.h index ee46e2b1a2..59bb6e5a4a 100644 --- a/Applications/Piano/KeysWidget.h +++ b/Applications/Piano/KeysWidget.h @@ -50,7 +50,7 @@ private: virtual void mouseup_event(GUI::MouseEvent&) override; virtual void mousemove_event(GUI::MouseEvent&) override; - int note_for_event_position(const Gfx::Point&) const; + int note_for_event_position(const Gfx::IntPoint&) const; AudioEngine& m_audio_engine; diff --git a/Applications/Piano/RollWidget.cpp b/Applications/Piano/RollWidget.cpp index b46989b0f1..d9968225d9 100644 --- a/Applications/Piano/RollWidget.cpp +++ b/Applications/Piano/RollWidget.cpp @@ -98,7 +98,7 @@ void RollWidget::paint_event(GUI::PaintEvent& event) int x_pos = x * m_note_width; int next_x_pos = (x + 1) * m_note_width; int distance_to_next_x = next_x_pos - x_pos; - Gfx::Rect rect(x_pos, y_pos, distance_to_next_x, note_height); + Gfx::IntRect rect(x_pos, y_pos, distance_to_next_x, note_height); if (key_pattern[key_pattern_index] == Black) painter.fill_rect(rect, Color::LightGray); @@ -128,7 +128,7 @@ void RollWidget::paint_event(GUI::PaintEvent& event) int y = ((note_count - 1) - note) * note_height; int height = note_height; - Gfx::Rect rect(x, y, width, height); + Gfx::IntRect rect(x, y, width, height); painter.fill_rect(rect, note_pressed_color); painter.draw_rect(rect, Color::Black); } diff --git a/Applications/Piano/SamplerWidget.cpp b/Applications/Piano/SamplerWidget.cpp index 64817fc32a..f3f116ebe4 100644 --- a/Applications/Piano/SamplerWidget.cpp +++ b/Applications/Piano/SamplerWidget.cpp @@ -74,12 +74,12 @@ void WaveEditor::paint_event(GUI::PaintEvent& event) int left_y = sample_to_y(recorded_sample[x].left); int right_y = sample_to_y(recorded_sample[x].right); - Gfx::Point left_point1(prev_x * width_scale, left_prev_y); - Gfx::Point left_point2(x * width_scale, left_y); + Gfx::IntPoint left_point1(prev_x * width_scale, left_prev_y); + Gfx::IntPoint left_point2(x * width_scale, left_y); painter.draw_line(left_point1, left_point2, left_wave_colors[RecordedSample]); - Gfx::Point right_point1(prev_x * width_scale, right_prev_y); - Gfx::Point right_point2(x * width_scale, right_y); + Gfx::IntPoint right_point1(prev_x * width_scale, right_prev_y); + Gfx::IntPoint right_point2(x * width_scale, right_y); painter.draw_line(right_point1, right_point2, right_wave_colors[RecordedSample]); prev_x = x; diff --git a/Applications/Piano/WaveWidget.cpp b/Applications/Piano/WaveWidget.cpp index 43fdf62d76..9a8cdebc94 100644 --- a/Applications/Piano/WaveWidget.cpp +++ b/Applications/Piano/WaveWidget.cpp @@ -71,12 +71,12 @@ void WaveWidget::paint_event(GUI::PaintEvent& event) int y_left = sample_to_y(buffer[x].left); int y_right = sample_to_y(buffer[x].right); - Gfx::Point point1_left(prev_x * width_scale, prev_y_left); - Gfx::Point point2_left(x * width_scale, y_left); + Gfx::IntPoint point1_left(prev_x * width_scale, prev_y_left); + Gfx::IntPoint point2_left(x * width_scale, y_left); painter.draw_line(point1_left, point2_left, left_wave_color); - Gfx::Point point1_right(prev_x * width_scale, prev_y_right); - Gfx::Point point2_right(x * width_scale, y_right); + Gfx::IntPoint point1_right(prev_x * width_scale, prev_y_right); + Gfx::IntPoint point2_right(x * width_scale, y_right); painter.draw_line(point1_right, point2_right, right_wave_color); prev_x = x; |