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: adding new property to tagged elements that are overlapped by others [TOL-2408] #894

Merged
merged 8 commits into from
Sep 20, 2024

Conversation

aodhagan-cf
Copy link
Collaborator

@aodhagan-cf aodhagan-cf commented Sep 18, 2024

Checking intersections of overlapping tagged elements and adding an attribute which is sent to the editor to stop rendering tagged elements which should be hidden.

  • For each 4 corners of the tagged elements calculate what the topmost element is at that point
  • If the topmost element is not the tagged element add property to hide tagged element

@aodhagan-cf aodhagan-cf requested a review from a team September 18, 2024 16:56
@aodhagan-cf aodhagan-cf marked this pull request as ready for review September 19, 2024 10:23
Comment on lines +238 to +239
coordinates: taggedElement.coordinates!,
isVisible: !!taggedElement.isVisible,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we fix the typings when we create the taggedElements?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added a new type now

PrecaulculatedTaggedElement

This just has the stuff that you can get directly from the tagged element, so element + attributes

The the actual TaggedElement has the calculated state without any conditional properties

export const addCalculatedAttributesToTaggedElements = (
taggedElements: PrecaulculatedTaggedElement[],
root = window.document,
): TaggedElement[] => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
): TaggedElement[] => {
): PrecaulculatedTaggedElement[] => {

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same then in 332

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No this should use the regular one as it now has added the calculations

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've merged for now, let me know I can follow up later on this if you disagree

@aodhagan-cf aodhagan-cf merged commit ba4d1c8 into main Sep 20, 2024
5 checks passed
@aodhagan-cf aodhagan-cf deleted the fix/TOL-2408 branch September 20, 2024 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants