@@ -38,24 +38,32 @@ export class Context {
38
38
? values . attributeState . clone ( )
39
39
: AttributeState . default ( )
40
40
this . viewport = values . viewport
41
- this . refsHandler = values . refsHandler ?? null
42
- this . styleSheets = values . styleSheets ?? null
43
- this . textMeasure = values . textMeasure ?? new TextMeasure ( )
41
+ this . refsHandler = values . refsHandler
42
+ this . styleSheets = values . styleSheets
43
+ this . textMeasure = values . textMeasure
44
44
this . transform = values . transform ?? this . pdf . unitMatrix
45
45
this . withinClipPath = values . withinClipPath ?? false
46
46
this . withinUse = values . withinUse ?? false
47
47
}
48
48
49
- clone ( values : Partial < ContextOptions > = { } ) : Context {
49
+ clone (
50
+ values : {
51
+ viewport ?: Viewport
52
+ attributeState ?: AttributeState
53
+ transform ?: Matrix
54
+ withinClipPath ?: boolean
55
+ withinUse ?: boolean
56
+ } = { }
57
+ ) : Context {
50
58
return new Context ( this . pdf , {
51
- svg2pdfParameters : values . svg2pdfParameters ?? this . svg2pdfParameters ,
59
+ svg2pdfParameters : this . svg2pdfParameters ,
52
60
attributeState : values . attributeState
53
61
? values . attributeState . clone ( )
54
62
: this . attributeState . clone ( ) ,
55
63
viewport : values . viewport ?? this . viewport ,
56
- refsHandler : values . refsHandler ?? this . refsHandler ,
57
- styleSheets : values . styleSheets ?? this . styleSheets ,
58
- textMeasure : values . textMeasure ?? this . textMeasure ,
64
+ refsHandler : this . refsHandler ,
65
+ styleSheets : this . styleSheets ,
66
+ textMeasure : this . textMeasure ,
59
67
transform : values . transform ?? this . transform ,
60
68
withinClipPath : values . withinClipPath ?? this . withinClipPath ,
61
69
withinUse : values . withinUse ?? this . withinUse
@@ -69,7 +77,7 @@ export interface ContextOptions {
69
77
attributeState ?: AttributeState
70
78
refsHandler : ReferencesHandler
71
79
styleSheets : StyleSheets
72
- textMeasure ? : TextMeasure
80
+ textMeasure : TextMeasure
73
81
transform ?: Matrix
74
82
withinClipPath ?: boolean
75
83
withinUse ?: boolean
0 commit comments