@@ -13,7 +13,7 @@ use crate::render::text::TextStyle;
1313use crate :: render:: { LineCap , LinePaint } ;
1414
1515/// Specifies the way a point should be drawn to the map.
16- #[ derive( Debug , Clone , Serialize , Deserialize ) ]
16+ #[ derive( Debug , Clone ) ]
1717pub struct PointPaint < ' a > {
1818 pub ( crate ) shape : PointShape < ' a > ,
1919 pub ( crate ) offset : Vector2 < f32 > ,
@@ -36,13 +36,15 @@ impl<'a> PointPaint<'a> {
3636 pub fn sector ( color : Color , diameter : f32 , start_angle : f32 , end_angle : f32 ) -> Self {
3737 Self {
3838 offset : Vector2 :: default ( ) ,
39- shape : PointShape :: Sector ( SectorParameters {
40- fill : color. into ( ) ,
41- radius : diameter / 2.0 ,
42- start_angle,
43- end_angle,
39+ shape : PointShape :: Sector {
40+ parameters : SectorParameters {
41+ fill : color. into ( ) ,
42+ radius : diameter / 2.0 ,
43+ start_angle,
44+ end_angle,
45+ } ,
4446 outline : None ,
45- } ) ,
47+ } ,
4648 }
4749 }
4850
@@ -112,6 +114,7 @@ impl<'a> PointPaint<'a> {
112114 width : width as f64 ,
113115 offset : 0.0 ,
114116 line_cap : LineCap :: Round ,
117+ dasharray : None ,
115118 } )
116119 }
117120 _ => { }
@@ -133,27 +136,29 @@ impl<'a> PointPaint<'a> {
133136 }
134137}
135138
136- #[ derive( Debug , Clone , Serialize , Deserialize ) ]
137- #[ serde( tag = "type" ) ]
139+ #[ derive( Debug , Clone ) ]
138140pub ( crate ) enum PointShape < ' a > {
139141 Dot {
140142 color : Color ,
141143 } ,
142144 Circle {
143145 fill : CircleFill ,
144146 radius : f32 ,
145- outline : Option < LinePaint > ,
147+ outline : Option < LinePaint < ' a > > ,
148+ } ,
149+ Sector {
150+ parameters : SectorParameters ,
151+ outline : Option < LinePaint < ' a > > ,
146152 } ,
147- Sector ( SectorParameters ) ,
148153 Square {
149154 fill : Color ,
150155 size : f32 ,
151- outline : Option < LinePaint > ,
156+ outline : Option < LinePaint < ' a > > ,
152157 } ,
153158 FreeShape {
154159 fill : Color ,
155160 scale : f32 ,
156- outline : Option < LinePaint > ,
161+ outline : Option < LinePaint < ' a > > ,
157162 shape : Cow < ' a , ClosedContour < Point2 < f32 > > > ,
158163 } ,
159164 Label {
@@ -176,13 +181,12 @@ pub enum MarkerStyle {
176181 } ,
177182}
178183
179- #[ derive( Debug , Clone , Copy , Serialize , Deserialize ) ]
184+ #[ derive( Debug , Copy , Clone , Serialize , Deserialize ) ]
180185pub ( crate ) struct SectorParameters {
181186 pub fill : CircleFill ,
182187 pub radius : f32 ,
183188 pub start_angle : f32 ,
184189 pub end_angle : f32 ,
185- pub outline : Option < LinePaint > ,
186190}
187191
188192#[ derive( Debug , Clone , Copy , Serialize , Deserialize ) ]
0 commit comments