mirror of
https://github.com/fankes/pagecurl-multiplatform.git
synced 2025-09-06 02:35:25 +08:00
Update versions, add detekt and spotless
This commit is contained in:
@@ -27,7 +27,7 @@ android {
|
||||
compose true
|
||||
}
|
||||
composeOptions {
|
||||
kotlinCompilerExtensionVersion compose_version
|
||||
kotlinCompilerExtensionVersion compose_compiler_version
|
||||
}
|
||||
kotlinOptions {
|
||||
jvmTarget = "1.8"
|
||||
|
@@ -1,3 +1,5 @@
|
||||
@file:Suppress("LongParameterList", "LongMethod")
|
||||
|
||||
package eu.wewox.pagecurl.config
|
||||
|
||||
import androidx.compose.runtime.Composable
|
||||
|
@@ -63,6 +63,7 @@ public fun rememberPageCurlState(
|
||||
* The state of the PageCurl.
|
||||
*
|
||||
* @property max The max number of pages.
|
||||
* @property config The configuration for PageCurl.
|
||||
* @param initialCurrent The initial current page.
|
||||
*/
|
||||
@ExperimentalPageCurlApi
|
||||
|
@@ -38,7 +38,11 @@ internal fun Modifier.tapGesture(
|
||||
return@awaitPointerEventScope
|
||||
}
|
||||
|
||||
if (config.tapBackwardEnabled && config.tapBackwardInteraction.target.multiply(size).contains(up.position)) {
|
||||
if (config.tapBackwardEnabled &&
|
||||
config.tapBackwardInteraction.target
|
||||
.multiply(size)
|
||||
.contains(up.position)
|
||||
) {
|
||||
scope.launch {
|
||||
onTapBackward()
|
||||
}
|
||||
|
@@ -19,9 +19,12 @@ internal fun lineLineIntersection(
|
||||
val denominator = (line1a.x - line1b.x) * (line2a.y - line2b.y) - (line1a.y - line1b.y) * (line2a.x - line2b.x)
|
||||
if (denominator == 0f) return null
|
||||
|
||||
val x = ((line1a.x * line1b.y - line1a.y * line1b.x) * (line2a.x - line2b.x) -
|
||||
(line1a.x - line1b.x) * (line2a.x * line2b.y - line2a.y * line2b.x)) / denominator
|
||||
val y = ((line1a.x * line1b.y - line1a.y * line1b.x) * (line2a.y - line2b.y) -
|
||||
(line1a.y - line1b.y) * (line2a.x * line2b.y - line2a.y * line2b.x)) / denominator
|
||||
val x1 = (line1a.x * line1b.y - line1a.y * line1b.x) * (line2a.x - line2b.x)
|
||||
val x2 = (line1a.x - line1b.x) * (line2a.x * line2b.y - line2a.y * line2b.x)
|
||||
val x = (x1 - x2) / denominator
|
||||
|
||||
val y1 = (line1a.x * line1b.y - line1a.y * line1b.x) * (line2a.y - line2b.y)
|
||||
val y2 = (line1a.y - line1b.y) * (line2a.x * line2b.y - line2a.y * line2b.x)
|
||||
val y = (y1 - y2) / denominator
|
||||
return Offset(x, y)
|
||||
}
|
||||
|
Reference in New Issue
Block a user