Correct Kotlin types in avatar catalog and crop coordinates

This commit is contained in:
evgeny committed 2026-10-06 19:46:59 +02:00
1 parent 863441c418
commit a221452cb6
2 files changed
+3 -3

No files matched your search

@@ -56,7 +56,7 @@ object AvatarProtocol {
}
val remote = ByteArray(path).also { b.get(it) }; b.position(b.position() + target)
val body = ByteArray(payload).also { b.get(it) }
return Reply(id, group, server, owner, command, status, size, hash(hash), fileType, cursor, version, more,
return Reply(id, group, server, owner, command, status, size, hash(hash), fileType, cursor, version, more!=0,
String(remote, Charsets.UTF_8), body)
}
data class Entry(val file: String, val mtime: Long)
@@ -103,8 +103,8 @@ fun AvatarCropDialog(uri: Uri, onCancel: () -> Unit, onConfirm: (File, AvatarCro
TextButton(onClick=onCancel) { Text(stringResource(R.string.cancel)) }
TextButton(enabled=image!=null && source!=null && side>0,onClick={
val selected=requireNotNull(image)
val crop=AvatarCrop((selected.width*scale-side-2*dx)/(2*scale*selected.width),
(selected.height*scale-side-2*dy)/(2*scale*selected.height),
val crop=AvatarCrop(((selected.width*scale-side-2*dx)/(2*scale*selected.width)).toDouble(),
((selected.height*scale-side-2*dy)/(2*scale*selected.height)).toDouble(),
side.toDouble()/scale/selected.width,side.toDouble()/scale/selected.height)
handedOver=true; onConfirm(requireNotNull(source),crop)
}) { Text(stringResource(R.string.avatar_upload)) }