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

Use update boolean instead of hard set 'true' in modelsource submitModel #458

Merged
merged 1 commit into from
Jun 19, 2024

Conversation

jbicker
Copy link
Contributor

@jbicker jbicker commented Jun 19, 2024

Before setModel always ended up in UpdateModelAction which triggers (in that case) unwanted animations.

@jbicker jbicker requested a review from spoenemann June 19, 2024 12:11
Copy link
Contributor

@spoenemann spoenemann left a comment

Choose a reason for hiding this comment

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

Remark: the constant true value was originally used to keep the previous behavior in #103. The unexpected behavior should be fixed. If you want the model change to be animated, use updateModel.

@spoenemann spoenemann added this to the v1.3.0 milestone Jun 19, 2024
@spoenemann spoenemann merged commit 9aa2083 into master Jun 19, 2024
2 checks passed
@spoenemann spoenemann deleted the jbicker/fix-submitmodel branch June 19, 2024 12:20
@spoenemann
Copy link
Contributor

For reference: the reason for the constant true value was that before the introduction of the request/response scheme, there was no easy way to retain the value of that flag during the bounds computation phase:

protected handleComputedBounds(action: ComputedBoundsAction): void {
const root = this.currentRoot;
const index = new SModelIndex();
index.add(root);
for (const b of action.bounds) {
const element = index.getById(b.elementId);
if (element !== undefined)
this.applyBounds(element, b.newBounds);
}
if (action.alignments !== undefined) {
for (const a of action.alignments) {
const element = index.getById(a.elementId);
if (element !== undefined)
this.applyAlignment(element, a.newAlignment);
}
}
this.doSubmitModel(root, true, index);
}

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