@@ -40,15 +40,19 @@ def opacity(self, opacity: int):
4040 def alpha (self , alpha : int ):
4141 '''set layer alpha -- 0 to 255'''
4242 self .dd ._sendCommand (self .layer_id , "alpha" , str (alpha ))
43- def border (self , size : int , color , shape : str = "flat" ):
43+ def border (self , size , color , shape : str = "flat" , extra_size = 0 ):
4444 '''
4545 :param size: unit is pixel
4646 - LcdLayer; each character is composed of pixels
4747 - 7SegmentRowLayer; each 7-segment is composed of fixed 220 x 320 pixels
4848 - LedGridLayer; a LED is considered as a pixel
4949 :param shape: can be "flat", "round", "raised" or "sunken"
50+ :param extra_size just added to size; however if shape is "round", it affects the "roundness"
5051 '''
51- self .dd ._sendCommand (self .layer_id , "border" , str (size ), _DD_COLOR_ARG (color ), shape )
52+ if type (extra_size ) == int and extra_size == 0 :
53+ self .dd ._sendCommand (self .layer_id , "border" , str (size ), _DD_COLOR_ARG (color ), shape )
54+ else :
55+ self .dd ._sendCommand (self .layer_id , "border" , str (size ), _DD_COLOR_ARG (color ), shape , str (extra_size ))
5256 def noBorder (self ):
5357 self .dd ._sendCommand (self .layer_id , "border" )
5458 def padding (self , left , top , right , bottom ):
0 commit comments