add find bitmap nil args support

This commit is contained in:
vcaesar 2019-05-15 10:58:39 -04:00
parent 80aea16f32
commit 69aa3a798e

View File

@ -896,7 +896,7 @@ func FindBitmap(bit C.MMBitmapRef, args ...interface{}) (int, int) {
tolerance = 0.01 tolerance = 0.01
) )
if len(args) > 0 { if len(args) > 0 && args[0] != nil {
sbit = args[0].(C.MMBitmapRef) sbit = args[0].(C.MMBitmapRef)
} else { } else {
sbit = CaptureScreen() sbit = CaptureScreen()
@ -929,7 +929,7 @@ func FindPic(path string, args ...interface{}) (int, int) {
openbit := OpenBitmap(path) openbit := OpenBitmap(path)
if len(args) > 0 { if len(args) > 0 && args[0] != nil {
sbit = args[0].(C.MMBitmapRef) sbit = args[0].(C.MMBitmapRef)
} else { } else {
sbit = CaptureScreen() sbit = CaptureScreen()
@ -956,7 +956,7 @@ func FindEveryBitmap(bit C.MMBitmapRef, args ...interface{}) (int, int) {
lpos C.MMPoint lpos C.MMPoint
) )
if len(args) > 0 { if len(args) > 0 && args[0] != nil {
sbit = args[0].(C.MMBitmapRef) sbit = args[0].(C.MMBitmapRef)
} else { } else {
sbit = CaptureScreen() sbit = CaptureScreen()