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

LineChartRenderer context bug #746

Merged
merged 1 commit into from
Feb 10, 2016

Conversation

leoMehlig
Copy link
Contributor

In the LineChartRenderers drawLinear method the Context gets saved before checking for existing data.
This leads to never restoring the context, which causes other chart-components to disappear.

This commit fixes this by saving the context after the check for data.

The bug described above can be seen in the two GIFs below:

Behaviour with bug:

chart_bug

Behaviour with fix:

chart_fixed

Relates to #740

In the LineChartRenderers drawLinear method the Context gets saved, but
if there is no data to display it never gets restored.

This causes other components to disappear.

This commit fixes this by saving the context after the check for data
to display.
@danielgindi
Copy link
Collaborator

This is the correct fix :-) (Also note that there could have been use of defer which avoids the need to avoid return calls...

danielgindi added a commit that referenced this pull request Feb 10, 2016
Context was saved and sometimes not restored due to `return`
@danielgindi danielgindi merged commit 330bf57 into ChartsOrg:master Feb 10, 2016
@leoMehlig
Copy link
Contributor Author

defer would have executed the code after the fill function gets called, which could lead to other problems.

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