Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

avoid crash and provide a simple solution for very small log scales #116

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

elwerene
Copy link
Contributor

When using a log scale from 2 to 8, plotters crashes as tier_1 is zero and is later used as divisor. I made a simple fix by checking for zero tier_1 and providing a simple scale which iterates the integers between both numbers.

I know this is not a complete fix of the problem, especially as a small scale e.g. 0.2 to 0.8 would not show any grid lines, but the best idea a came up with at the moment and it always prevents the crash.

Sorry I had to close (#115) and reopen the pull request, but I did more work and just merging master would be wrong.

@codecov
Copy link

codecov bot commented Mar 13, 2020

Codecov Report

Merging #116 into master will increase coverage by 0.78%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #116      +/-   ##
==========================================
+ Coverage   66.24%   67.03%   +0.78%     
==========================================
  Files          53       53              
  Lines        5134     5129       -5     
==========================================
+ Hits         3401     3438      +37     
+ Misses       1733     1691      -42     
Impacted Files Coverage Δ
src/coord/logarithmic.rs 0.00% <0.00%> (ø)
src/chart/builder.rs 82.31% <0.00%> (+0.49%) ⬆️
src/chart/context.rs 78.66% <0.00%> (+0.66%) ⬆️
src/coord/datetime.rs 81.22% <0.00%> (+0.74%) ⬆️
src/coord/ranged.rs 43.47% <0.00%> (+1.08%) ⬆️
src/drawing/backend_impl/cairo.rs 89.74% <0.00%> (+1.46%) ⬆️
src/drawing/backend_impl/bitmap.rs 84.84% <0.00%> (+1.78%) ⬆️
src/style/size.rs 78.00% <0.00%> (+2.00%) ⬆️
src/drawing/backend_impl/svg.rs 75.79% <0.00%> (+2.31%) ⬆️
src/style/font/font_desc.rs 50.00% <0.00%> (+2.32%) ⬆️
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5cf3bfd...869f6fa. Read the comment docs.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant