Skip to content

Commit 9f58956

Browse files
Fixing feedback to drag (#553)
* Fixing feedback to drag * Update DragSelectionBox.kt
1 parent d694f4d commit 9f58956

3 files changed

Lines changed: 13 additions & 5 deletions

File tree

application/common_flows/wide_screen_common/src/commonMain/kotlin/io/writeopia/notes/desktop/components/DesktopApp.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ fun DesktopApp(
293293
Box(
294294
modifier = Modifier
295295
.height(60.dp)
296-
.width(16.dp)
296+
.width(24.dp)
297297
.align(alignment = Alignment.CenterStart)
298298
.clip(RoundedCornerShape(100))
299299
.clickable(onClick = globalShellViewModel::toggleSideMenu)

application/composeApp/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,8 @@ android {
176176
applicationId = "io.writeopia"
177177
minSdk = libs.versions.minSdk.get().toInt()
178178
targetSdk = libs.versions.targetSdk.get().toInt()
179-
versionCode = 43
180-
versionName = "0.30.0"
179+
versionCode = 46
180+
versionName = "0.33.0"
181181

182182
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
183183
}

writeopia_ui/src/commonMain/kotlin/io/writeopia/ui/components/multiselection/DragSelectionBox.kt

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import androidx.compose.ui.Modifier
1919
import androidx.compose.ui.geometry.Offset
2020
import androidx.compose.ui.graphics.Color
2121
import androidx.compose.ui.input.pointer.pointerInput
22+
import androidx.compose.ui.platform.LocalDensity
2223
import androidx.compose.ui.unit.dp
2324

2425
val LocalDragSelectionInfo = compositionLocalOf { DragSelectionInfo() }
@@ -28,6 +29,7 @@ fun DragSelectionBox(modifier: Modifier = Modifier, context: @Composable BoxScop
2829
var initialPosition by remember { mutableStateOf(Offset.Zero) }
2930
var finalPosition by remember { mutableStateOf(Offset.Zero) }
3031
var state by remember { mutableStateOf(DragSelectionInfo(isDragging = false)) }
32+
val density = LocalDensity.current
3133

3234
CompositionLocalProvider(LocalDragSelectionInfo provides state) {
3335
Box(
@@ -76,8 +78,14 @@ fun DragSelectionBox(modifier: Modifier = Modifier, context: @Composable BoxScop
7678
)
7779

7880
Box(
79-
modifier = Modifier.offset(x = x.dp, y = y.dp)
80-
.size(width = width.dp, height = height.dp)
81+
modifier = Modifier.offset(
82+
x = density.run { x.toDp() },
83+
y = density.run { y.toDp() }
84+
)
85+
.size(
86+
width = density.run { width.toDp() },
87+
height = density.run { height.toDp() }
88+
)
8189
.border(width = 1.dp, color = dragBoxColor, shape = shape)
8290
.background(
8391
color = dragBoxColor.copy(alpha = 0.2F),

0 commit comments

Comments
 (0)