-
Bug
-
Resolution: Done
-
Critical
-
Kogito Tooling 0.27.0
-
False
-
None
-
False
-
---
-
---
-
-
-
2023 Week 09-11 (from Feb 27)
The boudingBox values of states with icons and tooltip boxes are wrong.
The method that calculates the group boundingBox iterates over all elements in the group in order to calculate the final boundaries of an element. In this specific case the tooltip box is being added to the group although it is not visible until the user hoovers an icon. It is affecting the boundingBox calculations because the tooltip is part of the group and takes part in the calculations.
One possible solution is to refactor the tooltip box to be created on demand, so it could be created and destroyed dynamically and wouldn't affect the boundingBox calculations.
The issue was identified in failing test: https://github.com/kiegroup/kie-tools/blob/main/packages/vscode-extension-serverless-workflow-editor/it-tests/serverless-workflow-editor-extension-diagram-navigation.test.ts. The test is failing because of wrong dimensions of the state recovered through Canvas API. The test calculates the center of the node and then clicks to select it finally it asserts if the the cursor moves to the right line and column.
Example
Consider the workflow applicant-request-decision.sw.json and a state with icons and tooltips.
- Actual values:
- Dimensions: [574.5078125, 90]
- The expected values the state should be:
- Dimensions: [250, 90]
How to test:
- Open a diagram and then the Developer tools of the browser
- From the console tab select the "editorFrame" to have direct access to js canvas API object
- From the console get the node uuids with canvas.getNodeIds()
- Make sure the right node was picked with canvas.getWiresShape('uuid').setBackgroundColor("green") and then call draw canvas.draw()
- Get the dimensions of the node with canvas.getDimensions('uuid')
Acceptance criteria
The Canvas API returns correct dimensions.
Do not skip this test: https://github.com/kiegroup/kie-tools/pull/1505/files#diff-8692dd61479415223a34ee29e7a7e850e37b0285f018bad2883b77fe83bd6d47R46
- is related to
-
KOGITO-7999 Stunner - Editor API Canvas/Session/Domain Definitions exposed in JS
- Resolved
- is triggering
-
KOGITO-8798 Skip VSCode Select states test because of bug in Canvas API
- Resolved