Rename EditPageScreen to CropScreen
This commit is contained in:
@@ -55,7 +55,7 @@ import org.fairscan.app.ui.Navigation
|
|||||||
import org.fairscan.app.ui.Screen
|
import org.fairscan.app.ui.Screen
|
||||||
import org.fairscan.app.ui.components.rememberCameraPermissionState
|
import org.fairscan.app.ui.components.rememberCameraPermissionState
|
||||||
import org.fairscan.app.ui.screens.document.DocumentScreen
|
import org.fairscan.app.ui.screens.document.DocumentScreen
|
||||||
import org.fairscan.app.ui.screens.edit.EditPageScreen
|
import org.fairscan.app.ui.screens.crop.CropScreen
|
||||||
import org.fairscan.app.ui.screens.LibrariesScreen
|
import org.fairscan.app.ui.screens.LibrariesScreen
|
||||||
import org.fairscan.app.ui.screens.about.AboutEvent
|
import org.fairscan.app.ui.screens.about.AboutEvent
|
||||||
import org.fairscan.app.ui.screens.about.AboutScreen
|
import org.fairscan.app.ui.screens.about.AboutScreen
|
||||||
@@ -180,7 +180,7 @@ class MainActivity : ComponentActivity() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
is Screen.Main.EditImage -> {
|
is Screen.Main.EditImage -> {
|
||||||
EditPageScreen(
|
CropScreen(
|
||||||
pageId = documentUiState.currentPage?.key?.pageId ?: "",
|
pageId = documentUiState.currentPage?.key?.pageId ?: "",
|
||||||
initState = cropInitialState,
|
initState = cropInitialState,
|
||||||
navigation = navigation,
|
navigation = navigation,
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ import org.fairscan.app.ui.NavigationState
|
|||||||
import org.fairscan.app.ui.Screen
|
import org.fairscan.app.ui.Screen
|
||||||
import org.fairscan.app.ui.screens.document.CurrentPageUiState
|
import org.fairscan.app.ui.screens.document.CurrentPageUiState
|
||||||
import org.fairscan.app.ui.screens.document.DocumentUiState
|
import org.fairscan.app.ui.screens.document.DocumentUiState
|
||||||
import org.fairscan.app.ui.screens.edit.CropInitState
|
import org.fairscan.app.ui.screens.crop.CropInitState
|
||||||
import org.fairscan.app.ui.state.DocumentUiModel
|
import org.fairscan.app.ui.state.DocumentUiModel
|
||||||
import org.fairscan.app.ui.state.PageThumbnail
|
import org.fairscan.app.ui.state.PageThumbnail
|
||||||
import org.fairscan.imageprocessing.ColorMode
|
import org.fairscan.imageprocessing.ColorMode
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License along with
|
* You should have received a copy of the GNU General Public License along with
|
||||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
package org.fairscan.app.ui.screens.edit
|
package org.fairscan.app.ui.screens.crop
|
||||||
|
|
||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
import android.content.res.Configuration
|
import android.content.res.Configuration
|
||||||
@@ -64,13 +64,13 @@ import org.fairscan.imageprocessing.Quad
|
|||||||
@SuppressLint("UnusedMaterial3ScaffoldPaddingParameter")
|
@SuppressLint("UnusedMaterial3ScaffoldPaddingParameter")
|
||||||
@OptIn(ExperimentalMaterial3Api::class)
|
@OptIn(ExperimentalMaterial3Api::class)
|
||||||
@Composable
|
@Composable
|
||||||
fun EditPageScreen(
|
fun CropScreen(
|
||||||
pageId: String,
|
pageId: String,
|
||||||
initState: CropInitState,
|
initState: CropInitState,
|
||||||
navigation: Navigation,
|
navigation: Navigation,
|
||||||
onUpdatePageQuad: (Quad) -> Unit,
|
onUpdatePageQuad: (Quad) -> Unit,
|
||||||
) {
|
) {
|
||||||
val state = remember(pageId) { EditPageScreenState() }
|
val state = remember(pageId) { CropScreenState() }
|
||||||
val quadHandler = remember { QuadEditingHandler() }
|
val quadHandler = remember { QuadEditingHandler() }
|
||||||
|
|
||||||
if (initState is CropInitState.Ready && initState.pageId == pageId && state.bitmap == null) {
|
if (initState is CropInitState.Ready && initState.pageId == pageId && state.bitmap == null) {
|
||||||
@@ -145,7 +145,7 @@ private fun ActionButtons(
|
|||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
private fun DragQuadOverlay(
|
private fun DragQuadOverlay(
|
||||||
state: EditPageScreenState,
|
state: CropScreenState,
|
||||||
quadHandler: QuadEditingHandler,
|
quadHandler: QuadEditingHandler,
|
||||||
bmp: Bitmap
|
bmp: Bitmap
|
||||||
) {
|
) {
|
||||||
@@ -154,7 +154,7 @@ private fun DragQuadOverlay(
|
|||||||
val containerSize = state.containerSize!!
|
val containerSize = state.containerSize!!
|
||||||
val displaySize = QuadCoordinateUtils.calculateDisplaySize(bmp.width, bmp.height, containerSize)
|
val displaySize = QuadCoordinateUtils.calculateDisplaySize(bmp.width, bmp.height, containerSize)
|
||||||
val liftWiggleThresholdPx = with(LocalDensity.current) {
|
val liftWiggleThresholdPx = with(LocalDensity.current) {
|
||||||
EditPageScreenState.LIFT_WIGGLE_MAX_DISTANCE.toPx()
|
CropScreenState.LIFT_WIGGLE_MAX_DISTANCE.toPx()
|
||||||
}
|
}
|
||||||
|
|
||||||
QuadOverlay(
|
QuadOverlay(
|
||||||
@@ -238,7 +238,7 @@ private fun DragQuadOverlay(
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
private fun DragMagnifyingGlass(state: EditPageScreenState) {
|
private fun DragMagnifyingGlass(state: CropScreenState) {
|
||||||
// showLoupe becomes true immediately on touch-down and stays true for
|
// showLoupe becomes true immediately on touch-down and stays true for
|
||||||
// one additional second after the finger is lifted.
|
// one additional second after the finger is lifted.
|
||||||
val showLoupe = remember { mutableStateOf(false) }
|
val showLoupe = remember { mutableStateOf(false) }
|
||||||
@@ -314,7 +314,7 @@ fun EditPageScreenPreview() {
|
|||||||
BitmapFactory.decodeStream(input)
|
BitmapFactory.decodeStream(input)
|
||||||
}
|
}
|
||||||
val quad = Quad(Point(.1, .1), Point(.9, .1), Point(.9, .9), Point(.1, .9))
|
val quad = Quad(Point(.1, .1), Point(.9, .1), Point(.9, .9), Point(.1, .9))
|
||||||
EditPageScreen(
|
CropScreen(
|
||||||
pageId = "123",
|
pageId = "123",
|
||||||
initState = CropInitState.Ready("123",dummyImage, quad),
|
initState = CropInitState.Ready("123",dummyImage, quad),
|
||||||
navigation = dummyNavigation(),
|
navigation = dummyNavigation(),
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License along with
|
* You should have received a copy of the GNU General Public License along with
|
||||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
package org.fairscan.app.ui.screens.edit
|
package org.fairscan.app.ui.screens.crop
|
||||||
|
|
||||||
import android.graphics.Bitmap
|
import android.graphics.Bitmap
|
||||||
import androidx.compose.runtime.getValue
|
import androidx.compose.runtime.getValue
|
||||||
@@ -34,7 +34,7 @@ sealed interface CropInitState {
|
|||||||
) : CropInitState
|
) : CropInitState
|
||||||
}
|
}
|
||||||
|
|
||||||
class EditPageScreenState {
|
class CropScreenState {
|
||||||
companion object {
|
companion object {
|
||||||
val LIFT_WIGGLE_MAX_DISTANCE = 8.dp
|
val LIFT_WIGGLE_MAX_DISTANCE = 8.dp
|
||||||
const val LIFT_WIGGLE_WINDOW_MS = 70L
|
const val LIFT_WIGGLE_WINDOW_MS = 70L
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License along with
|
* You should have received a copy of the GNU General Public License along with
|
||||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
package org.fairscan.app.ui.screens.edit
|
package org.fairscan.app.ui.screens.crop
|
||||||
|
|
||||||
import android.graphics.Bitmap
|
import android.graphics.Bitmap
|
||||||
import androidx.compose.foundation.Canvas
|
import androidx.compose.foundation.Canvas
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License along with
|
* You should have received a copy of the GNU General Public License along with
|
||||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
package org.fairscan.app.ui.screens.edit
|
package org.fairscan.app.ui.screens.crop
|
||||||
|
|
||||||
import androidx.compose.ui.geometry.Offset
|
import androidx.compose.ui.geometry.Offset
|
||||||
import androidx.compose.ui.unit.IntSize
|
import androidx.compose.ui.unit.IntSize
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License along with
|
* You should have received a copy of the GNU General Public License along with
|
||||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
package org.fairscan.app.ui.screens.edit
|
package org.fairscan.app.ui.screens.crop
|
||||||
|
|
||||||
import androidx.compose.ui.geometry.Offset
|
import androidx.compose.ui.geometry.Offset
|
||||||
import androidx.compose.ui.unit.IntSize
|
import androidx.compose.ui.unit.IntSize
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License along with
|
* You should have received a copy of the GNU General Public License along with
|
||||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
package org.fairscan.app.ui.screens.edit
|
package org.fairscan.app.ui.screens.crop
|
||||||
|
|
||||||
import androidx.compose.foundation.Canvas
|
import androidx.compose.foundation.Canvas
|
||||||
import androidx.compose.foundation.layout.fillMaxSize
|
import androidx.compose.foundation.layout.fillMaxSize
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License along with
|
* You should have received a copy of the GNU General Public License along with
|
||||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
package org.fairscan.app.ui.screens.edit
|
package org.fairscan.app.ui.screens.crop
|
||||||
|
|
||||||
import androidx.compose.ui.geometry.Offset
|
import androidx.compose.ui.geometry.Offset
|
||||||
import org.assertj.core.api.Assertions.assertThat
|
import org.assertj.core.api.Assertions.assertThat
|
||||||
@@ -42,7 +42,7 @@ class EditPageScreenStateTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun initialState_hasCorrectDefaults() {
|
fun initialState_hasCorrectDefaults() {
|
||||||
val state = EditPageScreenState()
|
val state = CropScreenState()
|
||||||
|
|
||||||
assertThat(state.bitmap).isNull()
|
assertThat(state.bitmap).isNull()
|
||||||
assertThat(state.containerSize).isNull()
|
assertThat(state.containerSize).isNull()
|
||||||
@@ -57,7 +57,7 @@ class EditPageScreenStateTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun quadUpdates_workCorrectly() {
|
fun quadUpdates_workCorrectly() {
|
||||||
val state = EditPageScreenState()
|
val state = CropScreenState()
|
||||||
|
|
||||||
state.updateQuad(testQuad)
|
state.updateQuad(testQuad)
|
||||||
assertThat(state.editableQuad).isEqualTo(testQuad)
|
assertThat(state.editableQuad).isEqualTo(testQuad)
|
||||||
@@ -68,7 +68,7 @@ class EditPageScreenStateTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun cornerDragging_managesStateCorrectly() {
|
fun cornerDragging_managesStateCorrectly() {
|
||||||
val state = EditPageScreenState()
|
val state = CropScreenState()
|
||||||
|
|
||||||
// Corner drag starts correctly
|
// Corner drag starts correctly
|
||||||
for (i in 0 until 4) {
|
for (i in 0 until 4) {
|
||||||
@@ -91,7 +91,7 @@ class EditPageScreenStateTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun fullDragCycle_preservesQuadAfterDragEnds() {
|
fun fullDragCycle_preservesQuadAfterDragEnds() {
|
||||||
val state = EditPageScreenState()
|
val state = CropScreenState()
|
||||||
|
|
||||||
assertThat(state.isDragging()).isFalse()
|
assertThat(state.isDragging()).isFalse()
|
||||||
state.startCornerDrag(1)
|
state.startCornerDrag(1)
|
||||||
@@ -108,7 +108,7 @@ class EditPageScreenStateTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun onTouchDown_setsIsTouchingAndDragPosition() {
|
fun onTouchDown_setsIsTouchingAndDragPosition() {
|
||||||
val state = EditPageScreenState()
|
val state = CropScreenState()
|
||||||
val pos = Offset(100f, 200f)
|
val pos = Offset(100f, 200f)
|
||||||
|
|
||||||
state.onTouchDown(pos)
|
state.onTouchDown(pos)
|
||||||
@@ -120,7 +120,7 @@ class EditPageScreenStateTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun onTouchDown_withCornerIndex_storesCornerIndex() {
|
fun onTouchDown_withCornerIndex_storesCornerIndex() {
|
||||||
val state = EditPageScreenState()
|
val state = CropScreenState()
|
||||||
|
|
||||||
state.onTouchDown(Offset(50f, 50f), cornerIndex = 2)
|
state.onTouchDown(Offset(50f, 50f), cornerIndex = 2)
|
||||||
|
|
||||||
@@ -131,7 +131,7 @@ class EditPageScreenStateTest {
|
|||||||
@Test
|
@Test
|
||||||
fun onTouchDown_withEdgeIndex_storesEdgeIndex() {
|
fun onTouchDown_withEdgeIndex_storesEdgeIndex() {
|
||||||
// Edge index no longer exists; onTouchDown with no corner index leaves touchDownCornerIndex as -1.
|
// Edge index no longer exists; onTouchDown with no corner index leaves touchDownCornerIndex as -1.
|
||||||
val state = EditPageScreenState()
|
val state = CropScreenState()
|
||||||
|
|
||||||
state.onTouchDown(Offset(50f, 50f))
|
state.onTouchDown(Offset(50f, 50f))
|
||||||
|
|
||||||
@@ -141,7 +141,7 @@ class EditPageScreenStateTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun onTouchDown_overwritesPreviousTouchDown() {
|
fun onTouchDown_overwritesPreviousTouchDown() {
|
||||||
val state = EditPageScreenState()
|
val state = CropScreenState()
|
||||||
state.onTouchDown(Offset(10f, 10f), cornerIndex = 0)
|
state.onTouchDown(Offset(10f, 10f), cornerIndex = 0)
|
||||||
|
|
||||||
state.onTouchDown(Offset(50f, 50f), cornerIndex = 3)
|
state.onTouchDown(Offset(50f, 50f), cornerIndex = 3)
|
||||||
@@ -154,7 +154,7 @@ class EditPageScreenStateTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun onTouchUp_clearsIsTouchingAndTouchDownIndices() {
|
fun onTouchUp_clearsIsTouchingAndTouchDownIndices() {
|
||||||
val state = EditPageScreenState()
|
val state = CropScreenState()
|
||||||
state.onTouchDown(Offset(100f, 200f), cornerIndex = 1)
|
state.onTouchDown(Offset(100f, 200f), cornerIndex = 1)
|
||||||
|
|
||||||
state.onTouchUp()
|
state.onTouchUp()
|
||||||
@@ -165,7 +165,7 @@ class EditPageScreenStateTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun onTouchUp_preservesDragPosition() {
|
fun onTouchUp_preservesDragPosition() {
|
||||||
val state = EditPageScreenState()
|
val state = CropScreenState()
|
||||||
val pos = Offset(100f, 200f)
|
val pos = Offset(100f, 200f)
|
||||||
state.onTouchDown(pos, cornerIndex = 1)
|
state.onTouchDown(pos, cornerIndex = 1)
|
||||||
|
|
||||||
@@ -177,7 +177,7 @@ class EditPageScreenStateTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun onTouchUp_whenNotTouching_isIdempotent() {
|
fun onTouchUp_whenNotTouching_isIdempotent() {
|
||||||
val state = EditPageScreenState()
|
val state = CropScreenState()
|
||||||
|
|
||||||
state.onTouchUp()
|
state.onTouchUp()
|
||||||
|
|
||||||
@@ -189,7 +189,7 @@ class EditPageScreenStateTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun endDrag_preservesDragPosition() {
|
fun endDrag_preservesDragPosition() {
|
||||||
val state = EditPageScreenState()
|
val state = CropScreenState()
|
||||||
state.setInitialQuad(testQuad)
|
state.setInitialQuad(testQuad)
|
||||||
val pos = Offset(100f, 200f)
|
val pos = Offset(100f, 200f)
|
||||||
state.onTouchDown(pos, cornerIndex = 0)
|
state.onTouchDown(pos, cornerIndex = 0)
|
||||||
@@ -205,7 +205,7 @@ class EditPageScreenStateTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun endDrag_doesNotResetTouchDownIndices() {
|
fun endDrag_doesNotResetTouchDownIndices() {
|
||||||
val state = EditPageScreenState()
|
val state = CropScreenState()
|
||||||
state.setInitialQuad(testQuad)
|
state.setInitialQuad(testQuad)
|
||||||
state.onTouchDown(Offset(100f, 200f), cornerIndex = 2)
|
state.onTouchDown(Offset(100f, 200f), cornerIndex = 2)
|
||||||
state.startCornerDrag(2)
|
state.startCornerDrag(2)
|
||||||
@@ -218,7 +218,7 @@ class EditPageScreenStateTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun rollbackLastDragStepIfLikelyLiftWiggle_revertsRecentSmallStep() {
|
fun rollbackLastDragStepIfLikelyLiftWiggle_revertsRecentSmallStep() {
|
||||||
val state = EditPageScreenState()
|
val state = CropScreenState()
|
||||||
state.updateQuad(testQuad)
|
state.updateQuad(testQuad)
|
||||||
state.startCornerDrag(0)
|
state.startCornerDrag(0)
|
||||||
|
|
||||||
@@ -232,7 +232,7 @@ class EditPageScreenStateTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun rollbackLastDragStepIfLikelyLiftWiggle_keepsLargeStep() {
|
fun rollbackLastDragStepIfLikelyLiftWiggle_keepsLargeStep() {
|
||||||
val state = EditPageScreenState()
|
val state = CropScreenState()
|
||||||
state.updateQuad(testQuad)
|
state.updateQuad(testQuad)
|
||||||
state.startCornerDrag(0)
|
state.startCornerDrag(0)
|
||||||
|
|
||||||
@@ -246,7 +246,7 @@ class EditPageScreenStateTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun rollbackLastDragStepIfLikelyLiftWiggle_keepsOldSmallStep() {
|
fun rollbackLastDragStepIfLikelyLiftWiggle_keepsOldSmallStep() {
|
||||||
val state = EditPageScreenState()
|
val state = CropScreenState()
|
||||||
state.updateQuad(testQuad)
|
state.updateQuad(testQuad)
|
||||||
state.startCornerDrag(0)
|
state.startCornerDrag(0)
|
||||||
|
|
||||||
@@ -260,7 +260,7 @@ class EditPageScreenStateTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun endDrag_clearsLastDragStepTracking() {
|
fun endDrag_clearsLastDragStepTracking() {
|
||||||
val state = EditPageScreenState()
|
val state = CropScreenState()
|
||||||
state.updateQuad(testQuad)
|
state.updateQuad(testQuad)
|
||||||
state.startCornerDrag(0)
|
state.startCornerDrag(0)
|
||||||
|
|
||||||
@@ -277,7 +277,7 @@ class EditPageScreenStateTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun tapCycle_leavesStateConsistent() {
|
fun tapCycle_leavesStateConsistent() {
|
||||||
val state = EditPageScreenState()
|
val state = CropScreenState()
|
||||||
val pos = Offset(100f, 200f)
|
val pos = Offset(100f, 200f)
|
||||||
|
|
||||||
state.onTouchDown(pos, cornerIndex = 3)
|
state.onTouchDown(pos, cornerIndex = 3)
|
||||||
@@ -294,7 +294,7 @@ class EditPageScreenStateTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun dragCycle_corner_leavesStateConsistent() {
|
fun dragCycle_corner_leavesStateConsistent() {
|
||||||
val state = EditPageScreenState()
|
val state = CropScreenState()
|
||||||
state.setInitialQuad(testQuad)
|
state.setInitialQuad(testQuad)
|
||||||
val pos = Offset(100f, 200f)
|
val pos = Offset(100f, 200f)
|
||||||
|
|
||||||
@@ -321,7 +321,7 @@ class EditPageScreenStateTest {
|
|||||||
fun dragCycle_edge_leavesStateConsistent() {
|
fun dragCycle_edge_leavesStateConsistent() {
|
||||||
// Edge dragging is no longer supported; this test verifies that a touch
|
// Edge dragging is no longer supported; this test verifies that a touch
|
||||||
// without a valid corner index simply does not trigger a drag.
|
// without a valid corner index simply does not trigger a drag.
|
||||||
val state = EditPageScreenState()
|
val state = CropScreenState()
|
||||||
state.setInitialQuad(testQuad)
|
state.setInitialQuad(testQuad)
|
||||||
val pos = Offset(150f, 80f)
|
val pos = Offset(150f, 80f)
|
||||||
|
|
||||||
@@ -339,7 +339,7 @@ class EditPageScreenStateTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun consecutiveTaps_eachSetsCorrectTouchDownIndex() {
|
fun consecutiveTaps_eachSetsCorrectTouchDownIndex() {
|
||||||
val state = EditPageScreenState()
|
val state = CropScreenState()
|
||||||
|
|
||||||
state.onTouchDown(Offset(10f, 10f), cornerIndex = 0)
|
state.onTouchDown(Offset(10f, 10f), cornerIndex = 0)
|
||||||
assertThat(state.touchDownCornerIndex).isEqualTo(0)
|
assertThat(state.touchDownCornerIndex).isEqualTo(0)
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License along with
|
* You should have received a copy of the GNU General Public License along with
|
||||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
package org.fairscan.app.ui.screens.edit
|
package org.fairscan.app.ui.screens.crop
|
||||||
|
|
||||||
import androidx.compose.ui.geometry.Offset
|
import androidx.compose.ui.geometry.Offset
|
||||||
import org.assertj.core.api.Assertions.assertThat
|
import org.assertj.core.api.Assertions.assertThat
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License along with
|
* You should have received a copy of the GNU General Public License along with
|
||||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
package org.fairscan.app.ui.screens.edit
|
package org.fairscan.app.ui.screens.crop
|
||||||
|
|
||||||
import androidx.compose.ui.geometry.Offset
|
import androidx.compose.ui.geometry.Offset
|
||||||
import androidx.compose.ui.unit.IntSize
|
import androidx.compose.ui.unit.IntSize
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License along with
|
* You should have received a copy of the GNU General Public License along with
|
||||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
package org.fairscan.app.ui.screens.edit
|
package org.fairscan.app.ui.screens.crop
|
||||||
|
|
||||||
import androidx.compose.ui.geometry.Offset
|
import androidx.compose.ui.geometry.Offset
|
||||||
import androidx.compose.ui.unit.IntSize
|
import androidx.compose.ui.unit.IntSize
|
||||||
Reference in New Issue
Block a user