schizophrenicmaniac opened a new pull request, #21846:
URL: https://github.com/apache/echarts/pull/21846
<!-- Please fill in the following information to help us review your PR more
efficiently. -->
## Brief Information
This pull request is in the type of:
- [x] bug fixing
- [ ] new feature
- [ ] others
### What does this PR do?
Saves the fill/stroke a running style animation is heading to as the normal
colours, so the default emphasis colour is lifted from the new colour after a
universal transition.
### Fixed issues
- Fixes #21845: Hover emphasis lightens the previous colour after an update
with universalTransition
## Details
### Before: What was the problem?
With `universalTransition: true`, `series:transition` runs before
`updateStates`. The transition calls `animateFrom({ style: from.style })`,
which writes the old style onto the element right away. `savePathStates` then
reads `el.style.fill` and saves the old colour as `normalFill`, and the default
emphasis lifts that. In the issue's example the bars turn green after the
update, but hovering one shows a light blue (`rgba(34,104,235,1)`).
### After: How does it behave after the fixing?
`savePathStates` now looks at the element's running `style` animators (state
transitions excluded, same as `getFromStateStyle`) and uses `animator.saveTo`
to take the final fill/stroke. Hovering a bar in the example now gives the
light green (`rgba(22,176,81,1)`), the same as with `universalTransition:
false`. If nothing is animating, the saved values are the same as before.
Added a unit test in `test/ut/spec/series/bar.test.ts` that reproduces the
issue.
## Document Info
One of the following should be checked.
- [x] This PR doesn't relate to document changes
- [ ] The document should be updated later
- [ ] The document changes have been made in apache/echarts-doc#xxx
## Misc
### Security Checking
- [ ] This PR uses security-sensitive Web APIs.
<!-- PLEASE CHECK IT AGAINST:
<https://github.com/apache/echarts/wiki/Security-Checklist-for-Code-Contributors>
-->
### ZRender Changes
- [ ] This PR depends on ZRender changes (ecomfe/zrender#xxx).
### Related test cases or examples to use the new APIs
N.A.
### Merging options
- [ ] Please squash the commits into a single one when merging.
### Other information
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]