@@ -3551,6 +3551,31 @@ def set_stroke(self, width=1, color='black'):
35513551 self .style ['stroke-width' ] = str (width )
35523552
35533553
3554+ class SvgPolygon (SvgPolyline ):
3555+ def __init__ (self , _maxlen = None , * args , ** kwargs ):
3556+ super (SvgPolygon , self ).__init__ (_maxlen , * args , ** kwargs )
3557+ self .type = 'polygon'
3558+
3559+ def set_stroke (self , width = 1 , color = 'black' ):
3560+ """Sets the stroke properties.
3561+
3562+ Args:
3563+ width (int): stroke width
3564+ color (str): stroke color
3565+ """
3566+ self .attributes ['stroke' ] = color
3567+ self .attributes ['stroke-width' ] = str (width )
3568+
3569+ def set_fill (self , color = 'black' ):
3570+ """Sets the fill color.
3571+
3572+ Args:
3573+ color (str): stroke color
3574+ """
3575+ self .style ['fill' ] = color
3576+ self .attributes ['fill' ] = color
3577+
3578+
35543579class SvgText (SvgShape , _MixinTextualWidget ):
35553580
35563581 @decorate_constructor_parameter_types ([int , int , str ])
@@ -3595,3 +3620,4 @@ def set_fill(self, color='black'):
35953620 color (str): stroke color
35963621 """
35973622 self .attributes ['fill' ] = color
3623+
0 commit comments