Skip to content

Commit

Permalink
kie-issues#881: On the DMN Editor, resizing an empty Decision Service…
Browse files Browse the repository at this point in the history
… shouldn't let its divider line stay out of its bounds (apache#2145)
  • Loading branch information
tiagobento authored Feb 6, 2024
1 parent b86f319 commit 5f743c0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/dmn-editor/src/mutations/resizeNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import { MIN_NODE_SIZES } from "../diagram/nodes/DefaultSizes";
import { NODE_TYPES } from "../diagram/nodes/NodeTypes";
import { SnapGrid } from "../store/Store";
import { addOrGetDrd } from "./addOrGetDrd";
import { DECISION_SERVICE_DIVIDER_LINE_PADDING } from "./updateDecisionServiceDividerLine";

export function resizeNode({
definitions,
Expand Down Expand Up @@ -68,6 +69,10 @@ export function resizeNode({
if (change.nodeType === NODE_TYPES.decisionService) {
const ds = definitions.drgElement![change.index] as DMN15__tDecisionService;

const dividerLineY =
shape["dmndi:DMNDecisionServiceDividerLine"]?.["di:waypoint"]?.[0]?.["@_y"] ?? shapeBounds["@_y"];
limit.y = dividerLineY + DECISION_SERVICE_DIVIDER_LINE_PADDING;

// We ignore handling the contents of the Decision Service when it is external
if (!change.isExternal) {
ds.encapsulatedDecision?.forEach((ed) => {
Expand Down

0 comments on commit 5f743c0

Please sign in to comment.