Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove extra spacing between 2 activity markers #3052

Merged
merged 2 commits into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/component/mxgraph/shape/activity-shapes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ import { getBpmnIsInstantiating } from '../style/utils';
import { buildPaintParameter } from './render/icon-painter';
import { orderActivityMarkers } from './render/utils';

function getMarkerIconOriginFunction(allMarkers: number, markerOrder: number): (canvas: BpmnCanvas) => void {
return allMarkers === 1
function getMarkerIconOriginFunction(numberOfMarkers: number, markerPosition: number): (canvas: BpmnCanvas) => void {
return numberOfMarkers === 1
? (canvas: BpmnCanvas) => canvas.setIconOriginForIconBottomCentered()
: (canvas: BpmnCanvas) => {
// Here we suppose that we have 'allMarkers === 2'
// Here we suppose that we have 'numberOfMarkers === 2'
// More markers will be supported when implementing adhoc subprocess or compensation marker
canvas.setIconOriginForIconBottomCentered();
const xTranslation = Math.pow(-1, markerOrder) * (StyleDefault.SHAPE_ACTIVITY_MARKER_ICON_SIZE / 2 + StyleDefault.SHAPE_ACTIVITY_MARKER_ICON_MARGIN);
const xTranslation = (Math.pow(-1, markerPosition) * (StyleDefault.SHAPE_ACTIVITY_MARKER_ICON_SIZE + StyleDefault.SHAPE_ACTIVITY_MARKER_ICON_MARGIN)) / 2;
canvas.translateIconOrigin(xTranslation, 0);
};
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading