From 77d720d64096a35e8022d6175e91126e424d68b6 Mon Sep 17 00:00:00 2001 From: thecozies <79979276+thecozies@users.noreply.github.com> Date: Tue, 29 Jul 2025 10:27:54 -0500 Subject: [PATCH] ability to rotate elements --- src/ui/elements/ui_style.cpp | 4 ++++ src/ui/elements/ui_style.h | 1 + 2 files changed, 5 insertions(+) diff --git a/src/ui/elements/ui_style.cpp b/src/ui/elements/ui_style.cpp index f854181..00e104b 100644 --- a/src/ui/elements/ui_style.cpp +++ b/src/ui/elements/ui_style.cpp @@ -713,4 +713,8 @@ namespace recompui { set_or_add_transformation(Rml::Transforms::Scale2D(scale_x, scale_y)); } + void Style::set_rotation(float degrees) { + set_or_add_transformation(Rml::Transforms::Rotate2D(degrees)); + } + } // namespace recompui diff --git a/src/ui/elements/ui_style.h b/src/ui/elements/ui_style.h index 539d05e..8362c64 100644 --- a/src/ui/elements/ui_style.h +++ b/src/ui/elements/ui_style.h @@ -111,6 +111,7 @@ namespace recompui { void set_font_family(std::string_view family); void set_translate_2D(float x, float y, Unit unit = Unit::Dp); void set_scale_2D(float scale_x, float scale_y); + void set_rotation(float degrees); virtual void set_nav_auto(NavDirection dir); virtual void set_nav_none(NavDirection dir); virtual void set_nav(NavDirection dir, Element* element);