← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #231495]: highlight (and other region methods?) not working with Region subclass

 

Question #231495 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/231495

    Status: Open => Answered

RaiMan proposed the following answer:
Ok, you are absolutely right. This mangling of Region classes should not
produce an effect like yours.

But when I tested your script as pasted above, it did not run,because in
line 39

regionToExpand = MyRegion(Region(317,107,22,16)).highlight(1)

does not work (regionToExpand is set to None, because in RC3 highlight()
does not return a region but nothing) and gives a "None type object does
not have ...."

when changing to
regionToExpand = MyRegion(Region(317,107,22,16))  #.highlight(1)

everything works as expected: ( changed line 5 to < print self > )
>reference coords: printing boundaryRegion coords
Region[307,71 1122x544]@Screen(0)[0,0 1440x900] E:Y, T:3,0 E:Y, T:3,0
[log] highlight Region[307,71 1122x544]@Screen(0)[0,0 1440x900] E:Y, T:3,0 E:Y, T:3,0 for 1.0 secs
>padding regionToExpand
>MyRegion.pad: start
>MyRegion.pad: printing coords before pad
Region[317,107 22x16]@Screen(0)[0,0 1440x900] E:Y, T:3,0 E:Y, T:3,0
>MyRegion.pad: printing coords after pad
Region[-83,-293 822x816]@Screen(0)[0,0 1440x900] E:Y, T:3,0 E:Y, T:3,0
>>MyRegion.trimToBounds: caller is: pad
>>trimToBounds: printing coords of self
Region[-83,-293 822x816]@Screen(0)[0,0 1440x900] E:Y, T:3,0 E:Y, T:3,0
>>trimToBounds: printing coords of bounds
Region[307,71 1122x544]@Screen(0)[0,0 1440x900] E:Y, T:3,0 E:Y, T:3,0
>>trimToBounds: printing coords of intersection
>>>>>>>>>>>>>>>>>>>>>> x: 307 y: 71 w: 432 h: 452
>>trimToBounds: printing coords after intersection applied
Region[307,71 432x452]@Screen(0)[0,0 1440x900] E:Y, T:3,0 E:Y, T:3,0
>>MyRegion.trimToBounds: over
>MyRegion.pad: printing coords after trim
Region[307,71 432x452]@Screen(0)[0,0 1440x900] E:Y, T:3,0 E:Y, T:3,0
>MyRegion.pad: over
RESIZED REGION PROPERTY COMPARISON:
myRegion raw properties: x: 307 y: 71 w: 432 h: 452
myRegion raw getters: x: 307 y: 71 w: 432 h: 452
myRegion getRect properties: x: 307 y: 71 w: 432 h: 452
myRegion getRect getters: x: 307.0 y: 71.0 w: 432.0 h: 452.0
region raw properties: x: 307 y: 71 w: 432 h: 452
region raw getters: x: 307 y: 71 w: 432 h: 452
region getRect properties: x: 307 y: 71 w: 432 h: 452
region getRect getters: x: 307.0 y: 71.0 w: 432.0 h: 452.0
[log] highlight Region[307,71 432x452]@Screen(0)[0,0 1440x900] E:Y, T:3,0 E:Y, T:3,0 for 1.0 secs
[log] highlight Region[307,71 432x452]@Screen(0)[0,0 1440x900] E:Y, T:3,0 E:Y, T:3,0 for 1.0 secs

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.