@@ -37,7 +37,7 @@ class WorkflowImage {
37
37
width : app . canvas . canvas . width ,
38
38
height : app . canvas . canvas . height ,
39
39
offset : app . canvas . ds . offset ,
40
- transform : app . canvas . canvas . getContext ( '2d' ) . getTransform ( ) , // Save the original transformation matrix
40
+ transform : app . canvas . canvas . getContext ( "2d" ) . getTransform ( ) , // Save the original transformation matrix
41
41
} ;
42
42
}
43
43
@@ -46,7 +46,7 @@ class WorkflowImage {
46
46
app . canvas . canvas . width = this . state . width ;
47
47
app . canvas . canvas . height = this . state . height ;
48
48
app . canvas . ds . offset = this . state . offset ;
49
- app . canvas . canvas . getContext ( '2d' ) . setTransform ( this . state . transform ) ; // Reapply the original transformation matrix
49
+ app . canvas . canvas . getContext ( "2d" ) . setTransform ( this . state . transform ) ; // Reapply the original transformation matrix
50
50
}
51
51
52
52
updateView ( bounds ) {
@@ -427,9 +427,10 @@ class SvgWorkflowImage extends WorkflowImage {
427
427
}
428
428
429
429
getDrawTextConfig ( _ , widget ) {
430
+ const domWrapper = widget . inputEl . closest ( ".dom-widget" ) ?? widget . inputEl ;
430
431
return {
431
- x : parseInt ( widget . inputEl . style . left ) ,
432
- y : parseInt ( widget . inputEl . style . top ) ,
432
+ x : parseInt ( domWrapper . style . left ) ,
433
+ y : parseInt ( domWrapper . style . top ) ,
433
434
resetTransform : true ,
434
435
} ;
435
436
}
@@ -486,9 +487,7 @@ class SvgWorkflowImage extends WorkflowImage {
486
487
}
487
488
488
489
getBlob ( workflow ) {
489
- let svg = this . svgCtx
490
- . getSerializedSvg ( true )
491
- . replace ( "<svg " , `<svg style="background: ${ app . canvas . clear_background_color } " ` ) ;
490
+ let svg = this . svgCtx . getSerializedSvg ( true ) . replace ( "<svg " , `<svg style="background: ${ app . canvas . clear_background_color } " ` ) ;
492
491
493
492
if ( workflow ) {
494
493
svg = svg . replace ( "</svg>" , `<desc>${ SvgWorkflowImage . escapeXml ( workflow ) } </desc></svg>` ) ;
@@ -558,8 +557,9 @@ app.registerExtension({
558
557
const style = document . defaultView . getComputedStyle ( this . inputEl , null ) ;
559
558
const x = config . x ;
560
559
const y = config . y ;
561
- const w = parseInt ( this . inputEl . style . width ) ;
562
- const h = parseInt ( this . inputEl . style . height ) ;
560
+ const domWrapper = this . inputEl . closest ( ".dom-widget" ) ?? widget . inputEl ;
561
+ const w = parseInt ( domWrapper . style . width ) ;
562
+ const h = parseInt ( domWrapper . style . height ) ;
563
563
ctx . fillStyle = style . getPropertyValue ( "background-color" ) ;
564
564
ctx . fillRect ( x , y , w , h ) ;
565
565
0 commit comments