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

Renderer-calculated style values for an edge may not be fresh on call to getter #2608

Closed
maxkfranz opened this issue Jan 24, 2020 · 0 comments
Labels
bug A bug in the code of Cytoscape.js
Milestone

Comments

@maxkfranz
Copy link
Member

Issue type

Bug report

Environment info

  • Cytoscape.js version : 3.13.0
  • Browser/Node.js & version : Firefox 72.0.2 & Chrome 79.0.3945.79

Current (buggy) behaviour

A call to a function like edge.midpoint() may return a value that is not fresh w.r.t. recent bounds changes to the connected nodes.

Desired behaviour

For an edge whose connected nodes have recently changed bounds (position, width, etc.), calls to functions like edge.midpoint() should cause the renderer to recalculate the rendered style synchronously.

Minimum steps to reproduce

See #2595

@maxkfranz maxkfranz added this to the 3.13.1 milestone Jan 24, 2020
@maxkfranz maxkfranz added the bug A bug in the code of Cytoscape.js label Jan 24, 2020
maxkfranz added a commit that referenced this issue Jan 24, 2020
… to getter #2608

Rendered style is generally recalculated at the start of a frame rather than synchronously at the time of dirtying.  This avoids redundant calculations.  Further an edge is not explicitly dirtied when at least one of its connected nodes changes in dimensions (position, width, etc.).  Instead, it is implicitly marked as dirty via the `cleanConnected` flag on the node.

An immediate, synchronous recalculation of rendered style may happen for public functions that read rendered style, such as `edge.midpoint()`.  For this case, `recalculateRenderedStyle()` must check whether an edge is implicitly dirty via `cleanConnected`.
maxkfranz added a commit that referenced this issue Jan 24, 2020
… to getter #2608

Rendered style is generally recalculated at the start of a frame rather than synchronously at the time of dirtying.  This avoids redundant calculations.  Further an edge is not explicitly dirtied when at least one of its connected nodes changes in dimensions (position, width, etc.).  Instead, it is implicitly marked as dirty via the `cleanConnected` flag on the node.

An immediate, synchronous recalculation of rendered style may happen for public functions that read rendered style, such as `edge.midpoint()`.  For this case, `recalculateRenderedStyle()` must check whether an edge is implicitly dirty via `cleanConnected`.
maxkfranz added a commit that referenced this issue Jan 24, 2020
…t be fresh on call to getter #2608 #2609

Rendered style is generally recalculated at the start of a frame rather than synchronously at the time of dirtying.  This avoids redundant calculations.  Further an edge is not explicitly dirtied when at least one of its connected nodes changes in dimensions (position, width, etc.).  Instead, it is implicitly marked as dirty via the `cleanConnected` flag on the node.

An immediate, synchronous recalculation of rendered style may happen for public functions that read rendered style, such as `edge.midpoint()`.  For this case, `recalculateRenderedStyle()` must check whether an edge is implicitly dirty via `cleanConnected`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug in the code of Cytoscape.js
Projects
None yet
Development

No branches or pull requests

1 participant