diff --git a/UI/UI_elements.py b/UI/UI_elements.py index 1c9eea4..77fd93a 100644 --- a/UI/UI_elements.py +++ b/UI/UI_elements.py @@ -23,7 +23,7 @@ from settings import talk from UI import UI_color def roundrect(layer, win, x, y, width, height, r, button=False, icon=False, - tip="", fill=True, url="", clip=False): + tip="", fill=True, url="", clip=False, offset=[0,0]): # This function draws a rectangle with rounded edges. @@ -48,8 +48,8 @@ def roundrect(layer, win, x, y, width, height, r, button=False, icon=False, layer.stroke() - if win.current['mx'] in range(int(x), int(x+width)) \ - and win.current['my'] in range(int(y), int(y+height)) : + if win.current['mx'] in range(int(x+offset[0]), int(x+width+offset[0])) \ + and win.current['my'] in range(int(y+offset[1]), int(y+height+offset[1])) : do = True if clip: