-
-
Notifications
You must be signed in to change notification settings - Fork 6k
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
View port handler nonnil #2980
View port handler nonnil #2980
Conversation
Updating fork from main
Codecov Report
@@ Coverage Diff @@
## master #2980 +/- ##
==========================================
- Coverage 19.77% 19.64% -0.14%
==========================================
Files 113 113
Lines 13620 13508 -112
==========================================
- Hits 2694 2653 -41
+ Misses 10926 10855 -71
Continue to review full report at Codecov.
|
@jjatie is helping a lot. @danielgindi do you want to take these similar PRs about swift improvements? |
@liuxuan30 Now that you've looked at the other related PRs, is it okay for this to be merged? |
I‘m checking every day but can't guarantee I can review daily; I would try. Reviewing slowly right now, but I can get some merged for sure. |
I suggest in the future, similar improvements like remove optional can be squash into one PR, each commit could be one class or one topic to review, to reduce dependency and conflicts and makes it easier for you. |
Fixed |
@@ -221,8 +221,7 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate | |||
_animator = Animator() | |||
_animator.delegate = self | |||
|
|||
_viewPortHandler = ViewPortHandler() | |||
_viewPortHandler.setChartDimens(width: bounds.size.width, height: bounds.size.height) | |||
_viewPortHandler = ViewPortHandler(width: bounds.size.width, height: bounds.size.height) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think in some cases, setChartDimens()
is useful rather than re-init again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In some cases it is, that is why the method still exists. In this case it is not useful, as the only thing that is happening is what already happens in the initializer I changed it to.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the initialize
method, so it does need to be inited here.
@@ -12,21 +12,23 @@ | |||
import Foundation | |||
import CoreGraphics | |||
|
|||
//@objc(ChartRenderer) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is this, commented out code or documentation? If it's doc, maybe use doc style comment like /* or other
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That shouldn't be here at all. I was experimenting, but ultimately moved it all to another branch/PR. I missed this in the cleanup
let viewPortHandler = self.viewPortHandler | ||
else { return } | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
empty line? Not sure if this is github display issue, but if old guard is deleted, no space line needed. (ignore if there is no empty line)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll fix
generally it's good, but I need to take a look at viewport handler myself if nil is fine. |
Removed extraneous comment Removed extra whitespace
Fixed based on comments |
viewPortHandler = self.viewPortHandler | ||
else { return } | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
empty line?
let viewPortHandler = self.viewPortHandler | ||
else { return } | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
empty line?
let viewPortHandler = self.viewPortHandler | ||
else { return } | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
empty line?
let viewPortHandler = self.viewPortHandler | ||
else { return } | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
empty line?
{ | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
empty line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one should be here. The rest are now fixed
viewPortHandler = self.viewPortHandler | ||
else { return } | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
empty line?
Finished reviewing. |
No description provided.