summaryrefslogtreecommitdiff
path: root/Applications/Piano/KeysWidget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Applications/Piano/KeysWidget.cpp')
-rw-r--r--Applications/Piano/KeysWidget.cpp10
1 files changed, 5 insertions, 5 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;
}