mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-06-02 23:23:55 +00:00
add find bitmap nil args support
This commit is contained in:
parent
80aea16f32
commit
69aa3a798e
@ -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()
|
||||||
|
Loading…
Reference in New Issue
Block a user