1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 07:07:45 +00:00

LibGfx: Rename Rect,Point,Size => IntRect,IntPoint,IntSize

This fits nicer with FloatRect,FloatPoint,FloatSize and gives a much
better visual clue about what type of metric is being used.
This commit is contained in:
Andreas Kling 2020-06-10 10:57:59 +02:00
parent 656b01eb0f
commit 116cf92156
212 changed files with 1144 additions and 1144 deletions

View file

@ -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;
}