1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-27 02:20:36 +00:00

dialog:: in 2D matrix dialog, show degree unit, and do not negate

This commit is contained in:
Zeno Rogue 2023-08-14 17:44:22 +02:00
parent dff8db44b0
commit 3e1228b7c7

View File

@ -301,7 +301,8 @@ EX namespace dialog {
ld as_degrees(transmatrix T) { ld as_degrees(transmatrix T) {
hyperpoint h = T * point31(1, 0, 0); hyperpoint h = T * point31(1, 0, 0);
ld alpha = atan2(h[1], h[0]); ld alpha = atan2(-h[1], h[0]);
if(alpha == 0) alpha = 0;
return alpha / degree; return alpha / degree;
} }
@ -1148,7 +1149,7 @@ EX namespace dialog {
if(dim == 2) { if(dim == 2) {
static ld angle; static ld angle;
angle = as_degrees(*edit_matrix); angle = as_degrees(*edit_matrix);
addSelItem("enter angle", fts(angle), 'a'); addSelItem("enter angle", fts(angle) + "°", 'a');
dialog::add_action([this] { dialog::add_action([this] {
editNumber(angle, -180, 180, 90, 0, title, help); editNumber(angle, -180, 180, 90, 0, title, help);
auto& ne = get_ne(); auto& ne = get_ne();