Region(x, y, w, h) - what are w and h?

Asked by sgfit

Per http://doc.sikuli.org/region.html, a Region is created with Region(x, y, w, h). However, the documentation then says:

Parameters:
x – x position of a rectangle.
y – y position of a rectangle.
w – height of a rectangle.
h – width of a rectangle.

Obviously, it is very unusual to have "w" represent height and "h" represent width.

This leaves two possibilities, which could not be clearly determined by testing:

1) The signature definition is wrong: the definition should be Region(x, y, height, width).
2) The parameter description is wrong: w is the width and h is the height.

What is the correct signature?

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Manfred Hampl (m-hampl) said :
#1

Remark, in the example below http://doc.sikuli.org/region.html#creatingaregionsettingandgettingattributes there is code using the width value for height assignment. This might be also misleading.

theWidth = reg.getW()
...
reg.setH(theWidth)

This sets the height of the region equal to the width, i.e. a square region.

I.m.h.o. a better example would be something like

theWidth = reg.getW()
..
theHeight= theWidth / 2
...
reg.setH(theHeigth)

to avoid using the width value in a height assignment.

Revision history for this message
RaiMan (raimund-hocke) said :
#2

I changed the actual docs for 1.1.x (was a typo)

Be aware:
http://doc.sikuli.org
are the docs up to 1.0RC3 and are no longer maintained.

the actual docs are here:
http://sikulix-2014.readthedocs.io/en/latest/index.html

Revision history for this message
RaiMan (raimund-hocke) said :
#3

@Manfred
einverstanden ;-)

Can you help with this problem?

Provide an answer of your own, or ask sgfit for more information if necessary.

To post a message you must log in.