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(core): ensure base layer has index 0 #585

Merged
merged 1 commit into from
Nov 8, 2021

Conversation

marstamm
Copy link
Contributor

@marstamm marstamm commented Nov 5, 2021

This reverts commit 058731b and uses a positive index to place resize layers infront of rendered content

Why we need to revert:

Instead of lowering the index of planes, we should use the existing API to ensure our utility planes are rendered with priority

@marstamm marstamm self-assigned this Nov 5, 2021
@bpmn-io-tasks bpmn-io-tasks bot added the needs review Review pending label Nov 5, 2021
@@ -172,7 +174,7 @@ ResizeHandles.prototype.removeResizers = function() {
};

ResizeHandles.prototype._getResizersParent = function() {
return this._canvas.getLayer('resizers');
return this._canvas.getLayer('resizers', LAYER_INDEX);
Copy link
Member

Choose a reason for hiding this comment

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

I don't like that change as it essentially means all special layers must explicitly render on top of the base layer.

What about the following:

  • if no priority is given, layers render with priority 1
  • base layers + plane layers render with the priority of 0

Please keep the canvas spec around. We should aim to fix this as part of our core.

Copy link
Member

Choose a reason for hiding this comment

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

I don't like that change as it essentially means all special layers must explicitly render on top of the base layer.

This means: Breaking change for everyone who created layers in the past, bpmn-js, some extension we don't yet know about...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense, we don't want a major release for this 👍

@@ -172,7 +174,7 @@ ResizeHandles.prototype.removeResizers = function() {
};

ResizeHandles.prototype._getResizersParent = function() {
return this._canvas.getLayer('resizers');
return this._canvas.getLayer('resizers', LAYER_INDEX);
Copy link
Member

Choose a reason for hiding this comment

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

I don't like that change as it essentially means all special layers must explicitly render on top of the base layer.

This means: Breaking change for everyone who created layers in the past, bpmn-js, some extension we don't yet know about...

@marstamm marstamm force-pushed the fix-default-plane-position branch 2 times, most recently from 812d913 to 40ca9f5 Compare November 5, 2021 14:08
@marstamm marstamm requested a review from nikku November 5, 2021 14:11
@nikku
Copy link
Member

nikku commented Nov 5, 2021

Reverted the original bug (002d395) which gives us time to investigate this one in an orderly manner.

@nikku nikku marked this pull request as draft November 5, 2021 22:26
@bpmn-io-tasks bpmn-io-tasks bot added in progress Currently worked on and removed needs review Review pending labels Nov 5, 2021
@marstamm marstamm requested a review from nikku November 8, 2021 08:32
@nikku nikku marked this pull request as ready for review November 8, 2021 10:01
@bpmn-io-tasks bpmn-io-tasks bot added needs review Review pending and removed in progress Currently worked on labels Nov 8, 2021
Copy link
Member

@nikku nikku left a comment

Choose a reason for hiding this comment

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

Very nicely done.

Thanks for adding the additional tests that cover the layering behavior (base vs. utility layers) 👏 🏅.

@fake-join fake-join bot merged commit b929f08 into develop Nov 8, 2021
@fake-join fake-join bot deleted the fix-default-plane-position branch November 8, 2021 10:52
@bpmn-io-tasks bpmn-io-tasks bot removed the needs review Review pending label Nov 8, 2021
@nikku
Copy link
Member

nikku commented Nov 8, 2021

I've also double checked it against bpmn-js@latest and can confirm bpmn-io/bpmn-js#1520 is fixed and other things continue to work, too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants