File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -528,7 +528,29 @@ export namespace ProjectUpgrader {
528528 break ;
529529 }
530530 case "core:svg_node" : {
531- // svg节点,先不管
531+ // svg节点,和图片一样,要处理附件
532+ const code = entity . content ;
533+ const attachmentId = crypto . randomUUID ( ) ;
534+ const blob = new Blob ( [ code ] , { type : "image/svg+xml" } ) ;
535+ attachments . set ( attachmentId , blob ) ;
536+ data = {
537+ _ : "SvgNode" ,
538+ uuid : entity . uuid ,
539+ attachmentId,
540+ details : toDetails ( entity . details ) ,
541+ collisionBox : {
542+ _ : "CollisionBox" ,
543+ shapes : [
544+ {
545+ _ : "Rectangle" ,
546+ location : toVector ( entity . location ) ,
547+ size : toVector ( entity . size ) ,
548+ } ,
549+ ] ,
550+ } ,
551+ scale : entity . scale || 1 ,
552+ color : toColor ( entity . color ) ,
553+ } ;
532554 break ;
533555 }
534556 default : {
You can’t perform that action at this time.
0 commit comments