1414const uuid = require ( 'uuid-v4' ) ;
1515const TextStyle = require ( '../TextStyle' ) ;
1616const Fill = require ( '../Fill' ) ;
17+ const Blur = require ( '../Blur' ) ;
1718const Border = require ( '../Border' ) ;
1819const Shadow = require ( '../Shadow' ) ;
1920const GraphicsContextSettings = require ( '../GraphicsContextSettings' ) ;
@@ -70,6 +71,8 @@ class Style {
7071 * @param {Object[] } args.fills Sent to {@link Fill}
7172 * @param {Object[] } args.borders Sent to {@link Border}
7273 * @param {Object[] } args.shadows Sent to {@link Shadow}
74+ * @param {Object } args.textStyle Sent to {@link TextStyle}
75+ * @param {Blur } args.blur Sent to {@link Blur}
7376 * @param {Style.Model } json
7477 */
7578 constructor ( args = { } , json ) {
@@ -79,14 +82,16 @@ class Style {
7982 if ( this . fills ) this . fills = this . fills . map ( ( fill ) => new Fill ( null , fill ) ) ;
8083 if ( this . borders ) this . borders = this . borders . map ( ( border ) => new Border ( null , border ) ) ;
8184 if ( this . shadows ) this . shadows = this . shadows . map ( ( shadow ) => new Shadow ( null , shadow ) ) ;
85+ if ( this . blur ) this . blur = new Blur ( this . blur ) ;
8286 } else {
8387 const id = args . id || uuid ( ) . toUpperCase ( ) ;
8488 Object . assign ( this , Style . Model , {
8589 do_objectID : id ,
8690 borders : ( args . borders || [ ] ) . map ( ( border ) => new Border ( border ) ) ,
8791 fills : ( args . fills || [ ] ) . map ( ( fill ) => new Fill ( fill ) ) ,
8892 shadows : ( args . shadows || [ ] ) . map ( ( shadow ) => new Shadow ( shadow ) ) ,
89- textStyle : args . textStyle ? new TextStyle ( args . textStyle ) : undefined ,
93+ ...( args . textStyle ? { textStyle : new TextStyle ( args . textStyle ) } : { } ) ,
94+ ...( args . blur ? { blur : new Blur ( args . blur ) } : { } ) ,
9095 } ) ;
9196 }
9297 }
0 commit comments