You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
first of all thank you for this very nice project. I really appreciate the work. Currently I am facing an error during the draw process of the SubsamplingScaleImageView.
java.lang.NullPointerException: Attempt to read from field 'float android.graphics.PointF.x' on a null object reference
at com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView.onDraw(SubsamplingScaleImageView.java:969)
I already debugged into the line and figured out that this.anim.vFocusStart is null. Maybe a simple nullcheck before the call will fix the issue.
Thank you and keep up the good work.
The text was updated successfully, but these errors were encountered:
tobsinger
changed the title
Nullpointer in SubsamplingScaleImageView.onDraw()
NullPointer in SubsamplingScaleImageView.onDraw()
Aug 31, 2017
It's hard to see how this would happen in normal use. Can you describe when it happens, whether it's before load, after load, on touch, drag, zoom, fling, custom animation or whatever?
I think the only way vFocusStart can be null is the anim was started some time after it was constructed, and the view was reset in the meantime. I can guard against that but it would be good to know what the real cause is.
I've added a basic fix for the NPE but not addressed any possible root cause. I suspect when this NPE happens the view is in a reset or loading state so the animation can be safely ignored. If you do find why this was happening let me know!
Hi,
first of all thank you for this very nice project. I really appreciate the work. Currently I am facing an error during the draw process of the SubsamplingScaleImageView.
It happens in this line:
float vFocusNowX = this.ease(this.anim.easing, scaleElapsed, this.anim.vFocusStart.x, this.anim.vFocusEnd.x - this.anim.vFocusStart.x, this.anim.duration);
I already debugged into the line and figured out that
this.anim.vFocusStart
is null. Maybe a simple nullcheck before the call will fix the issue.Thank you and keep up the good work.
The text was updated successfully, but these errors were encountered: