Skip to content

Commit

Permalink
Optimisations.
Browse files Browse the repository at this point in the history
  • Loading branch information
tizisdeepan committed Aug 19, 2019
1 parent 1bfa4df commit b25e237
Showing 1 changed file with 0 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,26 +78,19 @@ class VideoCropper @JvmOverloads constructor(context: Context, attrs: AttributeS
loadFrame(seekBar?.progress ?: 0)
}
})

cropFrame.setOnSetCropOverlayReleasedListener {
Log.e("RECT", it.toString())
}
}

fun onCropProgressChanged(progress: Int) {
val width: Int
val height: Int
val progressRatio = mMinRatio + ((abs(mMinRatio - mMaxRatio) / cropSeekbar.max) * progress)
Log.e("VIDEO DIMENSIONS", "$videoWidth : $videoHeight")
Log.e("PROGRESS RATIO", progressRatio.toString())
if (videoWidth > videoHeight) {
height = (videoWidth / progressRatio).toInt()
width = videoWidth
} else {
width = (progressRatio * videoHeight).toInt()
height = videoHeight
}
Log.e("ASPECT RATIO", "$width : $height : ${width.toFloat() / height.toFloat()}")
cropFrame.setAspectRatio(width, height)
}

Expand Down

0 comments on commit b25e237

Please sign in to comment.