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

Moving DraggableView Bug #6

Open
gintechsystems opened this issue May 13, 2017 · 1 comment
Open

Moving DraggableView Bug #6

gintechsystems opened this issue May 13, 2017 · 1 comment

Comments

@gintechsystems
Copy link

gintechsystems commented May 13, 2017

When moving the draggableView to quickly and touching either the beginning or end of the slider itself, the entire slider continues to grow in width.

@shadzik
Copy link

shadzik commented Aug 10, 2022

This bug is a bit older, and I have experienced it too. Here's a quick fix:

`
@@ -394,6 +394,7 @@ public class ABVideoRangeSlider: UIView, UIGestureRecognizerDelegate {
var progressPosition = positionFromValue(value: self.progressPercentage)
var startPosition = positionFromValue(value: self.startPercentage)
var endPosition = positionFromValue(value: self.endPercentage)

  •    let diff = endPosition - startPosition
    
       startPosition = startPosition + translation.x
       endPosition = endPosition + translation.x
    

@@ -403,12 +404,22 @@ public class ABVideoRangeSlider: UIView, UIGestureRecognizerDelegate {
startPosition = 0
endPosition = endPosition - translation.x
progressPosition = progressPosition - translation.x

  •        let newDiff = endPosition - startPosition
    
  •        if diff != newDiff {
    
  •            let delta = newDiff - diff
    
  •            endPosition = endPosition - delta
    
  •        }
       }
    
  •    if endPosition > self.frame.size.width{
    
  •    if endPosition > self.frame.size.width {
           endPosition = self.frame.size.width
           startPosition = startPosition - translation.x
           progressPosition = progressPosition - translation.x
    
  •        let newDiff = endPosition - startPosition
    
  •        if diff != newDiff {
    
  •            let delta = newDiff - diff
    
  •            startPosition = startPosition + delta
    
  •        }
       }
    
       recognizer.setTranslation(CGPoint.zero, in: self)
    

`

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

No branches or pull requests

2 participants