@@ -41,14 +41,16 @@ pub struct Style {
41
41
pub fill : Fill ,
42
42
pub stroke : Stroke ,
43
43
pub opacity : f32 ,
44
+ pub stroke_opacity : f32 ,
44
45
}
45
46
46
47
impl fmt:: Display for Style {
47
48
fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
48
- write ! ( f, "{};{};fill-opacity:{};" ,
49
+ write ! ( f, "{};{};fill-opacity:{};stroke-opacity:{}; " ,
49
50
self . fill,
50
51
self . stroke,
51
52
self . opacity,
53
+ self . stroke_opacity,
52
54
)
53
55
}
54
56
}
@@ -59,6 +61,7 @@ impl Style {
59
61
fill : Fill :: Color ( black ( ) ) ,
60
62
stroke : Stroke :: None ,
61
63
opacity : 1.0 ,
64
+ stroke_opacity : 1.0 ,
62
65
}
63
66
}
64
67
}
@@ -130,6 +133,11 @@ impl Rectangle {
130
133
self
131
134
}
132
135
136
+ pub fn stroke_opacity ( mut self , opacity : f32 ) -> Self {
137
+ self . style . stroke_opacity = opacity;
138
+ self
139
+ }
140
+
133
141
pub fn style ( mut self , style : Style ) -> Self {
134
142
self . style = style;
135
143
self
@@ -198,6 +206,10 @@ impl Circle {
198
206
self
199
207
}
200
208
209
+ pub fn stroke_opacity ( mut self , opacity : f32 ) -> Self {
210
+ self . style . stroke_opacity = opacity;
211
+ self
212
+ }
201
213
202
214
pub fn offset ( mut self , dx : f32 , dy : f32 ) -> Self {
203
215
self . x += dx;
@@ -284,6 +296,11 @@ impl Polygon {
284
296
self
285
297
}
286
298
299
+ pub fn stroke_opacity ( mut self , opacity : f32 ) -> Self {
300
+ self . style . stroke_opacity = opacity;
301
+ self
302
+ }
303
+
287
304
pub fn style ( mut self , style : Style ) -> Self {
288
305
self . style = style;
289
306
self
@@ -431,6 +448,11 @@ impl Path {
431
448
self
432
449
}
433
450
451
+ pub fn stroke_opacity ( mut self , opacity : f32 ) -> Self {
452
+ self . style . stroke_opacity = opacity;
453
+ self
454
+ }
455
+
434
456
pub fn style ( mut self , style : Style ) -> Self {
435
457
self . style = style;
436
458
self
0 commit comments