Skip to content

Commit cbdf3aa

Browse files
committed
COMMON: Fixed XPOS and YPOS to return 0 based values
1 parent bb10539 commit cbdf3aa

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

ChangeLog

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,13 @@
2525
Fixed problem with escaped chars using FORMAT
2626
Fixed problem with XNOR command result
2727
Fixed problem with IMP and EQV command result
28-
Fixed problem with INKEY command
28+
Fixed issues with INKEY command to allow ALT/SHIFT/CTRL states to be returned
2929
Fixed capslock handling
3030
Fixed issues with TRY/CATCH
3131
Fixed using POINT to retrieve IMAGE data
3232
Fixed issues with CHAIN
3333
Fixed TLOAD to work correctly with TRY/CATCH
34+
Fixed XPOS and YPOS to return 0 based values
3435

3536
2016-02-11
3637
Added export to mobile command (SDL)

src/common/blib_func.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,6 @@ var_num_t cmd_math1(long funcCode, var_t *arg) {
519519
r = atanh(x);
520520
#endif
521521
break;
522-
523522
case kwSEC:
524523
r = 1.0 / cos(x);
525524
break;
@@ -532,7 +531,6 @@ var_num_t cmd_math1(long funcCode, var_t *arg) {
532531
case kwASECH:
533532
r = log((1.0 + sqrt(1.0 - x * x)) / x);
534533
break;
535-
536534
case kwCSC:
537535
r = 1.0 / sin(x);
538536
break;
@@ -597,18 +595,18 @@ var_num_t cmd_math1(long funcCode, var_t *arg) {
597595
r = x;
598596
break;
599597
case kwXPOS:
600-
if (os_graphics)
598+
if (os_graphics) {
601599
r = dev_getx() / dev_textwidth("0");
602-
else
600+
} else {
603601
r = dev_getx();
604-
r++;
602+
}
605603
break;
606604
case kwYPOS:
607-
if (os_graphics)
605+
if (os_graphics) {
608606
r = dev_gety() / dev_textheight("0");
609-
else
607+
} else {
610608
r = dev_gety();
611-
r++;
609+
}
612610
break;
613611
case kwRND:
614612
r = ((var_num_t) rand()) / (RAND_MAX + 1.0);

0 commit comments

Comments
 (0)