diff --git a/src/cmd/misc/pixel-search.cr b/src/cmd/misc/pixel-search.cr index 5249858..46e379c 100644 --- a/src/cmd/misc/pixel-search.cr +++ b/src/cmd/misc/pixel-search.cr @@ -41,7 +41,7 @@ class Cmd::Misc::PixelSearch < Cmd::Base match_x = x + x1 match_y = y + y1 if thread.settings.coord_mode_pixel == ::Run::CoordMode::RELATIVE - match_y, match_x = Cmd::X11::Window::Util.coord_screen_to_relative(thread, match_y, match_x) + match_x, match_y = Cmd::X11::Window::Util.coord_screen_to_relative(thread, match_x, match_y) end thread.runner.set_user_var(out_x, match_x.to_s) if ! out_x.empty? thread.runner.set_user_var(out_y, match_y.to_s) if ! out_y.empty? diff --git a/tests.ahk b/tests.ahk index ec2cd16..3421df0 100755 --- a/tests.ahk +++ b/tests.ahk @@ -3,7 +3,7 @@ ; Right now, only commands that can be easily tested in 1-2 lines are tested. ;;;;;;;;;;;;;;;;;;;;;; -N_TESTS = 30 +N_TESTS = 32 GoSub, run_tests if tests_run != %N_TESTS% @@ -387,16 +387,15 @@ gosub assert ;Pause [, On|Off|Toggle] coordmode, pixel, relative -PixelGetColor, color, 24, 10, rgb +PixelGetColor, color, 26, 8, rgb expect = pixelgetcolor,color,7BC07B gosub assert PixelSearch, x, y, 0, 0, 100, 100, 0x7BC07B, 0, rgb -expect = pixelsearch,x,24 -; TODO broken? -; gosub assert -expect = pixelsearch,y,10 -; gosub assert +expect = pixelsearch,x,26 +gosub assert +expect = pixelsearch,y,8 +gosub assert ;;PostMessage, Msg [, wParam, lParam, Control, WinTitle, WinText, ExcludeTitle, ExcludeText] ;;Process, Cmd, PID-or-Name [, Param3]