diff --git a/dots/.config/quickshell/ii/modules/ii/screenTranslator/ScreenTextOverlay.qml b/dots/.config/quickshell/ii/modules/ii/screenTranslator/ScreenTextOverlay.qml index 8236fb189..7d87e69f9 100644 --- a/dots/.config/quickshell/ii/modules/ii/screenTranslator/ScreenTextOverlay.qml +++ b/dots/.config/quickshell/ii/modules/ii/screenTranslator/ScreenTextOverlay.qml @@ -274,6 +274,17 @@ Item { property real unscaledY: boundingVertices[0].y property real unscaledWidth: boundingVertices[1].x - boundingVertices[0].x property real unscaledHeight: boundingVertices[3].y - boundingVertices[0].y + + // Calculate rotation based on first two vertices (top-left to top-right) + property real dx: boundingVertices[1].x - boundingVertices[0].x + property real dy: boundingVertices[1].y - boundingVertices[0].y + transformOrigin: Item.TopLeft + rotation: { + // Note rotation in qml is degrees clockwise + var angle = Math.atan2(dy, dx) * 180 / Math.PI; + return angle; + } + x: unscaledX * scaleFactor y: unscaledY * scaleFactor width: unscaledWidth * scaleFactor