@@ -144,15 +144,19 @@ function ensureId(element: Element, prefix: string, usedIds: Set<string>) {
144144 return candidate ;
145145}
146146
147- function getBoundsForNode ( item : IDesignItem ) : Bounds {
147+ function getRawBoundsForNode ( item : IDesignItem ) : Bounds {
148148 const element = item . element as HTMLElement ;
149- const hostBounds = {
149+ return {
150150 x : parseCssPixels ( element . style . left ) ,
151151 y : parseCssPixels ( element . style . top ) ,
152152 width : parseCssPixels ( element . style . width , element . offsetWidth ) ,
153153 height : parseCssPixels ( element . style . height , element . offsetHeight )
154154 } ;
155- return getElementConnectionBoundsFromHostBounds ( hostBounds , element ) ;
155+ }
156+
157+ function getBoundsForNode ( item : IDesignItem ) : Bounds {
158+ const hostBounds = getRawBoundsForNode ( item ) ;
159+ return getElementConnectionBoundsFromHostBounds ( hostBounds , item . element as HTMLElement ) ;
156160}
157161
158162function getMeta ( instanceServiceContainer : InstanceServiceContainer ) : BpmnDocumentMeta {
@@ -1047,7 +1051,7 @@ export class BpmnParserService implements IHtmlParserService, IHtmlWriterService
10471051 writeLine ( ` <bpmndi:BPMNPlane id="${ escapeXml ( meta . planeId ) } " bpmnElement="${ escapeXml ( planeBpmnElement ) } ">` ) ;
10481052
10491053 for ( const nodeItem of nodeItems ) {
1050- const bounds = getBoundsForNode ( nodeItem ) ;
1054+ const bounds = getRawBoundsForNode ( nodeItem ) ;
10511055 const id = nodeIds . get ( nodeItem ) ! ;
10521056 const colorAttributes = getDiagramColorAttributes ( nodeItem . element as HTMLElement , true ) ;
10531057 writeLine ( ` <bpmndi:BPMNShape id="${ escapeXml ( id ) } _di" bpmnElement="${ escapeXml ( id ) } "${ colorAttributes . length ? ` ${ colorAttributes . join ( ' ' ) } ` : '' } >` ) ;
0 commit comments