代码拉取完成,页面将自动刷新
// Copyright 2017 Baliance. All rights reserved.
//
// Use of this source code is governed by the terms of the Affero GNU General
// Public License version 3.0 as published by the Free Software Foundation and
// appearing in the file LICENSE included in the packaging of this file. A
// commercial license can be purchased by contacting sales@baliance.com.
package drawing
import (
"baliance.com/gooxml"
"baliance.com/gooxml/color"
"baliance.com/gooxml/measurement"
"baliance.com/gooxml/schema/soo/dml"
)
type LineProperties struct {
x *dml.CT_LineProperties
}
// X returns the inner wrapped XML type.
func (l LineProperties) X() *dml.CT_LineProperties {
return l.x
}
// SetWidth sets the line width, MS products treat zero as the minimum width
// that can be displayed.
func (l LineProperties) SetWidth(w measurement.Distance) {
l.x.WAttr = gooxml.Int32(int32(w / measurement.EMU))
}
func (l LineProperties) clearFill() {
l.x.NoFill = nil
l.x.GradFill = nil
l.x.SolidFill = nil
l.x.PattFill = nil
}
func (l LineProperties) SetNoFill() {
l.clearFill()
l.x.NoFill = dml.NewCT_NoFillProperties()
}
func (l LineProperties) SetSolidFill(c color.Color) {
l.clearFill()
l.x.SolidFill = dml.NewCT_SolidColorFillProperties()
l.x.SolidFill.SrgbClr = dml.NewCT_SRgbColor()
l.x.SolidFill.SrgbClr.ValAttr = *c.AsRGBString()
}
// LineJoin is the type of line join
type LineJoin byte
// LineJoin types
const (
LineJoinRound LineJoin = iota
LineJoinBevel
LineJoinMiter
)
// SetJoin sets the line join style.
func (l LineProperties) SetJoin(e LineJoin) {
l.x.Round = nil
l.x.Miter = nil
l.x.Bevel = nil
switch e {
case LineJoinRound:
l.x.Round = dml.NewCT_LineJoinRound()
case LineJoinBevel:
l.x.Bevel = dml.NewCT_LineJoinBevel()
case LineJoinMiter:
l.x.Miter = dml.NewCT_LineJoinMiterProperties()
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。