Skip to content

Commit

Permalink
#5237 Fix for subroutine positioning
Browse files Browse the repository at this point in the history
  • Loading branch information
knsv committed Aug 9, 2024
1 parent 9b9f4ea commit db725c1
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ export const subroutine = async (parent: SVGAElement, node: Node) => {
const h = bbox.height + node.padding;
const x = -bbox.width / 2 - halfPadding;
const y = -bbox.height / 2 - halfPadding;
let rect;
const { cssStyles } = node;

const points = [
{ x: 0, y: 0 },
{ x: w, y: 0 },
Expand All @@ -69,9 +68,10 @@ export const subroutine = async (parent: SVGAElement, node: Node) => {

shapeSvg.insert(() => l1, ':first-child');
shapeSvg.insert(() => l2, ':first-child');
rect = shapeSvg.insert(() => roughNode, ':first-child');

const rect = shapeSvg.insert(() => roughNode, ':first-child');
const { cssStyles } = node;
rect.attr('class', 'basic label-container').attr('style', cssStyles);
updateNodeBounds(node, rect);
} else {
const el = insertPolygonShape(shapeSvg, w, h, points);
if (nodeStyles) {
Expand Down

0 comments on commit db725c1

Please sign in to comment.