Make Region.click() arguments optional
Bug #795498 reported by
anatoly techtonik
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SikuliX |
Fix Released
|
Critical
|
RaiMan |
Bug Description
Region.click() should click at its center. It will make code more clean (and perhaps faster), e.g. from:
for f in findAll(findobjs):
area = Region(
f.click(area)
to:
for f in findAll(findobjs):
area = Region(
area.click()
tags: | added: fkt-click |
Changed in sikuli: | |
importance: | Undecided → Critical |
Changed in sikuli: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
But this means some exception to the general API concept, which means with a Region.click(PSMRL) to restrict the find operation with PS to the given Region.
When using click(MRL) it is not necessary to specify a Region, since the argument denotes an absolute click point.
so the above example could be written:
for f in findAll(findobjs): f.nearby( 100))
area = Region(
click(area)
So with your approach you have to write an additional dot ;-)
And this does not have any impact on performance.
But if it is accepted by the developers, I would like to generalize this request:
a click() (no arguments given) should click:
Match.click() --- the defined target clickpoint
Region.click() --- the center
click() --- center of SCREEN
Location.click() --- the given point
same goes for rightClick(), doubleClick().