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

Added clamping function for Comparable #3435

Merged
merged 1 commit into from
May 17, 2018
Merged

Added clamping function for Comparable #3435

merged 1 commit into from
May 17, 2018

Conversation

jjatie
Copy link
Collaborator

@jjatie jjatie commented Apr 30, 2018

Adding convenience function. There is discussion in the Swift forums about adding this to the language, so we may be able to remove it in the future.

@codecov-io
Copy link

codecov-io commented Apr 30, 2018

Codecov Report

Merging #3435 into master will increase coverage by 0.06%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3435      +/-   ##
==========================================
+ Coverage   29.21%   29.27%   +0.06%     
==========================================
  Files         117      117              
  Lines       13303    13274      -29     
==========================================
  Hits         3886     3886              
+ Misses       9417     9388      -29
Impacted Files Coverage Δ
Source/Charts/Utils/ChartUtils.swift 46.11% <0%> (-1.74%) ⬇️
...plementations/Standard/LineRadarChartDataSet.swift 25% <0%> (+8.33%) ⬆️
Source/Charts/Components/ChartLimitLine.swift 0% <0%> (ø) ⬆️
Source/Charts/Components/AxisBase.swift 53.15% <0%> (+2.72%) ⬆️
.../Implementations/Standard/CandleChartDataSet.swift 0% <0%> (ø) ⬆️
...ta/Implementations/Standard/LineChartDataSet.swift 34.78% <0%> (+4.01%) ⬆️

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 e1c4f58...1b111e0. Read the comment docs.

@liuxuan30 liuxuan30 self-requested a review May 17, 2018 00:45
{
_lineWidth = newValue
}
_lineWidth = newValue.clamped(to: 0.2...12)
Copy link
Member

Choose a reason for hiding this comment

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

here 12 is cast to Double by default? is this new swift feature?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This has been the case since Swift 1

@liuxuan30 liuxuan30 merged commit cd673af into master May 17, 2018
shineeth pushed a commit to shineeth/Charts that referenced this pull request Oct 31, 2018
@jjatie jjatie deleted the clamping-function branch December 11, 2018 11:08
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.

None yet

3 participants