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

LibGfx: Rename RotationDirection members

Left => CounterClockwise
Right => Clockwise

Makes much more sense for a rotation
This commit is contained in:
Matthew Olsson 2021-05-02 22:38:29 -07:00 committed by Andreas Kling
parent f7ea1eb610
commit fbe712e265
3 changed files with 5 additions and 5 deletions

View file

@ -162,12 +162,12 @@ int main(int argc, char** argv)
auto rotate_left_action = GUI::Action::create("Rotate &Left", { Mod_None, Key_L }, auto rotate_left_action = GUI::Action::create("Rotate &Left", { Mod_None, Key_L },
[&](auto&) { [&](auto&) {
widget.rotate(Gfx::RotationDirection::Left); widget.rotate(Gfx::RotationDirection::CounterClockwise);
}); });
auto rotate_right_action = GUI::Action::create("Rotate &Right", { Mod_None, Key_R }, auto rotate_right_action = GUI::Action::create("Rotate &Right", { Mod_None, Key_R },
[&](auto&) { [&](auto&) {
widget.rotate(Gfx::RotationDirection::Right); widget.rotate(Gfx::RotationDirection::Clockwise);
}); });
auto vertical_flip_action = GUI::Action::create("Flip &Vertically", { Mod_None, Key_V }, auto vertical_flip_action = GUI::Action::create("Flip &Vertically", { Mod_None, Key_V },

View file

@ -357,7 +357,7 @@ RefPtr<Gfx::Bitmap> Bitmap::rotated(Gfx::RotationDirection rotation_direction) c
for (int i = 0; i < w; i++) { for (int i = 0; i < w; i++) {
for (int j = 0; j < h; j++) { for (int j = 0; j < h; j++) {
Color color; Color color;
if (rotation_direction == Gfx::RotationDirection::Left) if (rotation_direction == Gfx::RotationDirection::CounterClockwise)
color = this->get_pixel(w - i - 1, j); color = this->get_pixel(w - i - 1, j);
else else
color = this->get_pixel(i, h - j - 1); color = this->get_pixel(i, h - j - 1);

View file

@ -83,8 +83,8 @@ static StorageFormat determine_storage_format(BitmapFormat format)
struct BackingStore; struct BackingStore;
enum RotationDirection { enum RotationDirection {
Left, CounterClockwise,
Right Clockwise
}; };
class Bitmap : public RefCounted<Bitmap> { class Bitmap : public RefCounted<Bitmap> {