From 72d84c0cbdd0ad748dba19e21d4e92ea077110c7 Mon Sep 17 00:00:00 2001 From: xuri Date: Wed, 8 Sep 2021 22:05:42 +0800 Subject: This closes #262, support set line width of add the shape --- xmlDrawing.go | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'xmlDrawing.go') diff --git a/xmlDrawing.go b/xmlDrawing.go index b49ae9d..0bb11ac 100644 --- a/xmlDrawing.go +++ b/xmlDrawing.go @@ -234,14 +234,22 @@ type xlsxBlipFill struct { Stretch xlsxStretch `xml:"a:stretch"` } +// xlsxLineProperties specifies the width of a line in EMUs. This simple type +// has a minimum value of greater than or equal to 0. This simple type has a +// maximum value of less than or equal to 20116800. +type xlsxLineProperties struct { + W int `xml:"w,attr,omitempty"` +} + // xlsxSpPr directly maps the spPr (Shape Properties). This element specifies // the visual shape properties that can be applied to a picture. These are the // same properties that are allowed to describe the visual properties of a shape // but are used here to describe the visual appearance of a picture within a // document. type xlsxSpPr struct { - Xfrm xlsxXfrm `xml:"a:xfrm"` - PrstGeom xlsxPrstGeom `xml:"a:prstGeom"` + Xfrm xlsxXfrm `xml:"a:xfrm"` + PrstGeom xlsxPrstGeom `xml:"a:prstGeom"` + Ln xlsxLineProperties `xml:"a:ln"` } // xlsxPic elements encompass the definition of pictures within the DrawingML @@ -469,6 +477,7 @@ type formatShape struct { Height int `json:"height"` Format formatPicture `json:"format"` Color formatShapeColor `json:"color"` + Line formatLine `json:"line"` Paragraph []formatShapeParagraph `json:"paragraph"` } @@ -485,3 +494,8 @@ type formatShapeColor struct { Fill string `json:"fill"` Effect string `json:"effect"` } + +// formatLine directly maps the line settings of the shape. +type formatLine struct { + Width float64 `json:"width"` +} -- cgit v1.2.1