Fix sensors

Signed-off-by: Vasiliy Doylov <nekodevelopper@gmail.com>
This commit is contained in:
Vasiliy Doylov 2025-03-02 13:52:27 +03:00
parent 3dbae8afba
commit 8770668857
Signed by: NekoCWD
GPG key ID: B7BE22D44474A582
2 changed files with 2 additions and 2 deletions

View file

@ -25,7 +25,7 @@ class TheCatTools.GUI.BoubleBar : Gtk.DrawingArea, Gtk.Orientable {
}
double get_adjusted_value () {
var res = value;
var res = value * -1;
if (res > 90)
res = 180 - res;
if (res < -90)

View file

@ -37,7 +37,7 @@ public class TheCatTools.Window : Adw.ApplicationWindow {
accel.open_sync();
accel.measurement.connect((x, y, z) => {
var x_angle = rad2deg(Math.atan2(x, z));
var y_angle = rad2deg(Math.atan2(y, z));
var y_angle = rad2deg(Math.atan2(y, x));
message("%f\t%f\t%f", x, y, z);
message("%f\t%f", x_angle, y_angle);