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

API: Make CropWindowMoveHandler & CropWindowHandler internal. #467

Merged
merged 1 commit into from
Oct 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import kotlin.math.abs
import kotlin.math.max

/** Handler from crop window stuff, moving and knowing position. */
class CropWindowHandler {
internal class CropWindowHandler {

/** The 4 edges of the crop window defining its coordinates and size */
private val mEdges = RectF()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import kotlin.math.min
* @param touchX the location of the initial touch position to measure move distance
* @param touchY the location of the initial touch position to measure move distance
*/
class CropWindowMoveHandler(
internal class CropWindowMoveHandler(
/** The type of crop window move that is handled. */
private val type: Type,
cropWindowHandler: CropWindowHandler,
Expand All @@ -22,13 +22,11 @@ class CropWindowMoveHandler(
) {

/** The type of crop window move that is handled. */
enum class Type {

internal enum class Type {
TOP_LEFT, TOP_RIGHT, BOTTOM_LEFT, BOTTOM_RIGHT, LEFT, TOP, RIGHT, BOTTOM, CENTER
}

companion object {

internal companion object {
/** Calculates the aspect ratio given a rectangle. */
internal fun calculateAspectRatio(left: Float, top: Float, right: Float, bottom: Float) =
(right - left) / (bottom - top)
Expand Down