this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix ruby mouse coordinates (#2698)

authored by

Matt Zykan and committed by
GitHub
9724aed3 3ec8082d

+3 -2
+3 -2
src/api/mruby.c
··· 1012 1012 1013 1013 tic_core* core = getMRubyMachine(mrb); tic_mem* tic = (tic_mem*)core; 1014 1014 1015 + tic_point pos = core->api.mouse(tic); 1015 1016 const tic80_mouse* mouse = &tic->ram->input.mouse; 1016 1017 1017 1018 mrb_value hash = mrb_hash_new(mrb); 1018 1019 1019 - mrb_hash_set(mrb, hash, sym_x, mrb_fixnum_value(mouse->x)); 1020 - mrb_hash_set(mrb, hash, sym_y, mrb_fixnum_value(mouse->y)); 1020 + mrb_hash_set(mrb, hash, sym_x, mrb_fixnum_value(pos.x)); 1021 + mrb_hash_set(mrb, hash, sym_y, mrb_fixnum_value(pos.y)); 1021 1022 mrb_hash_set(mrb, hash, sym_left, mrb_bool_value(mouse->left)); 1022 1023 mrb_hash_set(mrb, hash, sym_middle, mrb_bool_value(mouse->middle)); 1023 1024 mrb_hash_set(mrb, hash, sym_right, mrb_bool_value(mouse->right));