@@ -38,24 +38,32 @@ export class Context {
3838 ? values . attributeState . clone ( )
3939 : AttributeState . default ( )
4040 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
4444 this . transform = values . transform ?? this . pdf . unitMatrix
4545 this . withinClipPath = values . withinClipPath ?? false
4646 this . withinUse = values . withinUse ?? false
4747 }
4848
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 {
5058 return new Context ( this . pdf , {
51- svg2pdfParameters : values . svg2pdfParameters ?? this . svg2pdfParameters ,
59+ svg2pdfParameters : this . svg2pdfParameters ,
5260 attributeState : values . attributeState
5361 ? values . attributeState . clone ( )
5462 : this . attributeState . clone ( ) ,
5563 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 ,
5967 transform : values . transform ?? this . transform ,
6068 withinClipPath : values . withinClipPath ?? this . withinClipPath ,
6169 withinUse : values . withinUse ?? this . withinUse
@@ -69,7 +77,7 @@ export interface ContextOptions {
6977 attributeState ?: AttributeState
7078 refsHandler : ReferencesHandler
7179 styleSheets : StyleSheets
72- textMeasure ? : TextMeasure
80+ textMeasure : TextMeasure
7381 transform ?: Matrix
7482 withinClipPath ?: boolean
7583 withinUse ?: boolean
0 commit comments