[request] want additional method signature Region.inside(left, right, top, bottom)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SikuliX |
Fix Released
|
Critical
|
RaiMan |
Bug Description
especially, when trying to use Region.text() optimally, I found the following helper very convenient (I have it in my basics):
def regInside(reg, left, right, top=0, bottom=0):
return Region(reg.x+left, reg.y+top, reg.w-left-right, reg.h-top-bottom)
This returns a new region inside the given one, with some padding left, right, top, bottom.
It would be helpful to have it as a Region method
def inside(reg, left, right, top=0, bottom=0):
the defaults for top and bottom: I found that it is mostly helpful to cut the region horizontally and keep the height.
e.g.
App.focus("Safari") # supposing Safari is running and shows a webpage
win = App.focusedWindow()
titleText = win.above(
so inside() helps to cut off the parts of the titlebar containing grafics.
Changed in sikuli: | |
importance: | Undecided → Wishlist |
Changed in sikuli: | |
status: | New → Fix Committed |
importance: | Wishlist → Critical |
assignee: | nobody → RaiMan (raimund-hocke) |
milestone: | none → x1.0 |
tags: | added: fkt-region |
Changed in sikuli: | |
status: | Fix Committed → Fix Released |
It would be nice is the syntax could be like this: getSubRegion( 50, 50, 50, 50)
NewRegion = OldRegion.