Skip to content

Commit d68f57f

Browse files
committed
fix parser
1 parent 036530b commit d68f57f

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

src/services/BpmnParserService.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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

158162
function 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

Comments
 (0)