mirror of
https://github.com/virtcode/hypr-dynamic-cursors
synced 2025-09-19 16:13:21 +02:00
parent
fcb4c2b87b
commit
bbe4709926
4 changed files with 10 additions and 0 deletions
|
@ -7,6 +7,7 @@ EModeUpdate CModeRotate::strategy() {
|
|||
|
||||
double CModeRotate::update(Vector2D pos) {
|
||||
static auto* const* PLENGTH = (Hyprlang::INT* const*)HyprlandAPI::getConfigValue(PHANDLE, CONFIG_LENGTH)->getDataStaticPtr();
|
||||
static auto* const* POFFSET = (Hyprlang::FLOAT* const*)HyprlandAPI::getConfigValue(PHANDLE, CONFIG_ROTATE_OFFSET)->getDataStaticPtr();
|
||||
|
||||
// translate to origin
|
||||
end.x -= pos.x;
|
||||
|
@ -25,6 +26,7 @@ double CModeRotate::update(Vector2D pos) {
|
|||
double angle = -std::atan(end.x / end.y);
|
||||
if (end.y > 0) angle += PI;
|
||||
angle += PI;
|
||||
angle += **POFFSET * ((2 * PI) / 360); // convert to radiants
|
||||
|
||||
// translate back
|
||||
end.x += pos.x;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue