1
mirror of https://github.com/DarkFlippers/unleashed-firmware.git synced 2025-12-13 13:09:49 +04:00

JS: Add textbox module (#3597)

* JS: Add textbox module
* Using view_holder instead of view_dispatcher, more checks in js_textbox_show
* API version sync
* Rename emptyText() to clearText()
* Keeping view_holder allocated for thread sefety
* Js: proper comparision with 0 in js_math_sign
* Js: add comments and fix condition race in textbox

Co-authored-by: あく <alleteam@gmail.com>
Co-authored-by: nminaylov <nm29719@gmail.com>
This commit is contained in:
WillyJL
2024-05-17 18:43:52 +01:00
committed by GitHub
parent c673b53e21
commit 0d456aa550
4 changed files with 260 additions and 1 deletions

View File

@@ -267,7 +267,8 @@ void js_math_sign(struct mjs* mjs) {
mjs_return(
mjs,
mjs_mk_number(mjs, x == (double)0. ? 0 : (x < (double)0. ? (double)-1.0 : (double)1.0)));
mjs_mk_number(
mjs, fabs(x) <= JS_MATH_EPSILON ? 0 : (x < (double)0. ? (double)-1.0 : (double)1.0)));
}
void js_math_sin(struct mjs* mjs) {