Skip to content

Commit 119ccd6

Browse files
committed
going for v0.2.1
1 parent e38983a commit 119ccd6

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ Notes:
127127
128128
v0.2.1
129129
- add plotter layer
130+
- added layer margin
130131
- bug fixes
131132
132133

dumbdisplay/_ddlayer.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)