Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit d9771b6

Browse files
committed
PaintData defaults
1 parent def757f commit d9771b6

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

lib/web_ui/lib/src/engine/surface/painting.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class SurfacePaint implements ui.Paint {
4646
}
4747

4848
@override
49-
ui.StrokeCap get strokeCap => _paintData.strokeCap!;
49+
ui.StrokeCap get strokeCap => _paintData.strokeCap ?? ui.StrokeCap.butt;
5050

5151
@override
5252
set strokeCap(ui.StrokeCap value) {
@@ -58,7 +58,7 @@ class SurfacePaint implements ui.Paint {
5858
}
5959

6060
@override
61-
ui.StrokeJoin get strokeJoin => _paintData.strokeJoin!;
61+
ui.StrokeJoin get strokeJoin => _paintData.strokeJoin ?? ui.StrokeJoin.miter;
6262

6363
@override
6464
set strokeJoin(ui.StrokeJoin value) {
@@ -82,7 +82,7 @@ class SurfacePaint implements ui.Paint {
8282
}
8383

8484
@override
85-
ui.Color get color => _paintData.color!;
85+
ui.Color get color => _paintData.color ?? _defaultPaintColor;
8686

8787
@override
8888
set color(ui.Color value) {
@@ -129,7 +129,7 @@ class SurfacePaint implements ui.Paint {
129129
}
130130

131131
@override
132-
ui.FilterQuality get filterQuality => _paintData.filterQuality!;
132+
ui.FilterQuality get filterQuality => _paintData.filterQuality ?? ui.FilterQuality.none;
133133

134134
@override
135135
set filterQuality(ui.FilterQuality value) {

0 commit comments

Comments
 (0)