← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #142168]: Unexpected result of Region.right()

 

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

    Status: Answered => Solved

Petr Fejfar confirmed that the question is solved:
> "extending the current region" is not correct

probably as well as "The new region will also include the current
region"... It is excluded actually

> But: the spatial operators do not change the current region, they
always return a new one - that might be assigned again to the > region
variable.

Yes, I know. The code was for demonstration only. FYI, I've written
utility function for my purpose:

def extendRegion(orgRegion,dx,dy,dw,dh):
	newRegion = Region(orgRegion)
	newRegion.setX(newRegion.getX()+dx)
	newRegion.setY(newRegion.getY()+dy)
	newRegion.setW(newRegion.getW()+dw-dx)
	newRegion.setH(newRegion.getH()+dh-dy)
	return newRegion

Thx for your support, pf

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