mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-05 09:06:08 +00:00
LibGfx: Rename RotationDirection members
Left => CounterClockwise Right => Clockwise Makes much more sense for a rotation
This commit is contained in:
parent
f7ea1eb610
commit
fbe712e265
Notes:
sideshowbarker
2024-07-18 17:50:59 +09:00
Author: https://github.com/mattco98
Commit: fbe712e265
Pull-request: https://github.com/SerenityOS/serenity/pull/7018
Reviewed-by: https://github.com/alimpfard
Reviewed-by: https://github.com/bcoles
Reviewed-by: https://github.com/tomuta
3 changed files with 5 additions and 5 deletions
|
@ -162,12 +162,12 @@ int main(int argc, char** argv)
|
|||
|
||||
auto rotate_left_action = GUI::Action::create("Rotate &Left", { Mod_None, Key_L },
|
||||
[&](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&) {
|
||||
widget.rotate(Gfx::RotationDirection::Right);
|
||||
widget.rotate(Gfx::RotationDirection::Clockwise);
|
||||
});
|
||||
|
||||
auto vertical_flip_action = GUI::Action::create("Flip &Vertically", { Mod_None, Key_V },
|
||||
|
|
|
@ -357,7 +357,7 @@ RefPtr<Gfx::Bitmap> Bitmap::rotated(Gfx::RotationDirection rotation_direction) c
|
|||
for (int i = 0; i < w; i++) {
|
||||
for (int j = 0; j < h; j++) {
|
||||
Color color;
|
||||
if (rotation_direction == Gfx::RotationDirection::Left)
|
||||
if (rotation_direction == Gfx::RotationDirection::CounterClockwise)
|
||||
color = this->get_pixel(w - i - 1, j);
|
||||
else
|
||||
color = this->get_pixel(i, h - j - 1);
|
||||
|
|
|
@ -83,8 +83,8 @@ static StorageFormat determine_storage_format(BitmapFormat format)
|
|||
struct BackingStore;
|
||||
|
||||
enum RotationDirection {
|
||||
Left,
|
||||
Right
|
||||
CounterClockwise,
|
||||
Clockwise
|
||||
};
|
||||
|
||||
class Bitmap : public RefCounted<Bitmap> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue