@@ -221,6 +221,9 @@ def get_ydata(self, orig=True):
221221 """
222222 return self .myobj .get_ydata (orig )
223223
224+ @staticmethod
225+ def get_validorientations ():
226+ return ('vertical' , 'horizontal' )
224227
225228class DragEllipse (_DragPatch ):
226229 def __init__ (self , ax , xy , width , height , angle = 0.0 , ** kwargs ):
@@ -297,6 +300,17 @@ def on_motion(self, event):
297300
298301 self .parentcanvas .draw ()
299302
303+ def get_bounds (self ):
304+ xy = self .myobj .get_xy ()
305+ if self .orientation == 'vertical' :
306+ return (xy [0 ], xy [0 ] + self .myobj .get_width ())
307+ elif self .orientation == 'horizontal' :
308+ return (xy [1 ], xy [1 ] + self .myobj .get_height ())
309+
310+ @staticmethod
311+ def get_validorientations ():
312+ return ('vertical' , 'horizontal' )
313+
300314
301315class Window :
302316 def __init__ (self , ax , primaryedge , windowstartsize , orientation = 'vertical' , snapto = None ,
@@ -306,6 +320,7 @@ def __init__(self, ax, primaryedge, windowstartsize, orientation='vertical', sna
306320 self .edges = []
307321 self .edges .append (DragLine2D (ax , primaryedge , orientation , snapto , color = edgecolor ))
308322 self .edges .append (DragLine2D (ax , (primaryedge + windowstartsize ), orientation , snapto , color = edgecolor ))
323+ self .orientation = orientation
309324
310325 # Add spanning rectangle
311326 xy , width , height = self .spanpatchdims (* self .edges )
@@ -338,6 +353,17 @@ def spanpatchdims(edge1, edge2):
338353
339354 return xy , width , height
340355
356+ def get_bounds (self ):
357+ xy = self .spanpatch .get_xy ()
358+ if self .orientation == 'vertical' :
359+ return (xy [0 ], xy [0 ] + self .spanpatch .get_width ())
360+ elif self .orientation == 'horizontal' :
361+ return (xy [1 ], xy [1 ] + self .spanpatch .get_height ())
362+
363+ @staticmethod
364+ def get_validorientations ():
365+ return ('vertical' , 'horizontal' )
366+
341367
342368class DragArc (_DragPatch ):
343369 def __init__ (self , ax , xy , width , height , angle = 0 , theta1 = 0 , theta2 = 360.00 , ** kwargs ):
0 commit comments