mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-22 13:02:38 +02:00
Fix calculation of the inline swkbd touch rectangle
This commit is contained in:
parent
d8a4f33192
commit
97fef5e48d
@ -612,7 +612,7 @@ s32 swkbdInlineGetTouchRectangles(SwkbdInline* s, SwkbdRect *keytop, SwkbdRect *
|
|||||||
float width = s->calcArg.keytopScaleX*image_width;
|
float width = s->calcArg.keytopScaleX*image_width;
|
||||||
float scale_y = s->calcArg.keytopScaleY;
|
float scale_y = s->calcArg.keytopScaleY;
|
||||||
float tmp_y = (keytop_max_height - 360.0f)*scale_y;
|
float tmp_y = (keytop_max_height - 360.0f)*scale_y;
|
||||||
keytop->x = lroundf(((width*-5.0f)+640.0f) + (s->calcArg.keytopTranslateX*image_width)); // This results in a negative value with the default keytopTranslateX. sdknso uses 5.0f, but 0.5f was likely (?) intended - we do the same as sdknso anyway though.
|
keytop->x = lroundf(((width*-0.5f)+640.0f) + (s->calcArg.keytopTranslateX*image_width));
|
||||||
keytop->y = lroundf((360.0f - tmp_y) - (s->calcArg.keytopTranslateY * 720.0f));
|
keytop->y = lroundf((360.0f - tmp_y) - (s->calcArg.keytopTranslateY * 720.0f));
|
||||||
keytop->width = lroundf(width);
|
keytop->width = lroundf(width);
|
||||||
keytop->height = lroundf(footer_max_height*scale_y);
|
keytop->height = lroundf(footer_max_height*scale_y);
|
||||||
|
Loading…
Reference in New Issue
Block a user