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

refactor: directly override svgCanvas2D.getTextCss #3046

Merged

Conversation

tbouffard
Copy link
Member

@tbouffard tbouffard commented Mar 1, 2024

Previously, this was done by modifying the mxSvgCanvas2D prototype. The new implementation limits side effects on applications that use mxGraph directly, and doesn't modify code the lib doesn't own.

The mxGraph implementation overriding is required to ensure that the label pointer-events is set to 'none'. New integration tests have been added to validate the old behavior and ensure that the refactoring has preserved it. In particular, more tests check the labels of a greater number of BPMN element types, and the value of the "pointer-events" property of labels is explicitly checked.

The overriding implementation has been simplified to reduce the copy/paste of mxGraph code. Instead, it now calls the standard mxGraph implementation with specific settings.

Notes

Continue the work started in #3043.

Previously, this was done by modifying the svgCanvas2D prototype.
The new implementation limits side effects on applications that use mxGraph directly, and don't modify code the lib
doesn't own.

The mxGraph implementation overriding is required to ensure that the label pointer-events is set to 'none'.
New integration tests have been added to validate the old behavior and ensure that the refactoring has preserved it.
In particular, more tests check the labels of a greater number of BPMN element types, and the value of the "pointer-events"
property of labels is explicitly checked.

The overriding implementation has been simplified to reduce the copy/paste of mxGraph code. Instead, it now calls the
standard mxGraph implementation with specific settings.
@tbouffard tbouffard added the refactoring Code refactoring label Mar 1, 2024
Copy link

github-actions bot commented Mar 1, 2024

♻️ PR Preview 79996cd has been successfully destroyed since this PR has been closed.

🤖 By surge-preview

Copy link

github-actions bot commented Mar 1, 2024

♻️ PR Preview 79996cd has been successfully destroyed since this PR has been closed.

🤖 By surge-preview

Copy link

sonarqubecloud bot commented Mar 4, 2024

@tbouffard tbouffard requested a review from csouchet March 4, 2024 08:03
@tbouffard tbouffard marked this pull request as ready for review March 4, 2024 08:03
@tbouffard tbouffard merged commit 1c613c8 into master Mar 4, 2024
24 checks passed
@tbouffard tbouffard deleted the refactor/no_mxSvgCanvas2D.getTextCss_prototype_override branch March 4, 2024 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring Code refactoring
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants