Pdf annotations fix (#99)

* Optimized high-res scale logic in PdfVerticalReader and adjusted layout padding in PdfViewerScreen

* Fixed position sync between both PDF reading modes

* Enabled annotation rendering in PDF tiles and improved scrolling state detection in `PdfVerticalReader` by introducing an `isDragging` flag.
This commit is contained in:
Aryan 2026-03-20 16:37:24 +05:30 committed by GitHub
parent a9c791120d
commit 9842aea9b1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 31 additions and 28 deletions

View file

@ -2196,10 +2196,16 @@ fun PdfViewerScreen(
}
LaunchedEffect(displayMode) {
coroutineScope.launch {
if (initialScrollDone) {
if (displayMode == DisplayMode.VERTICAL_SCROLL) {
val pageToScroll = pagerState.currentPage
verticalReaderState.scrollToPage(pageToScroll)
var attempts = 0
while (verticalReaderState.snapToPageHandler == null && attempts < 50) {
delay(16)
attempts++
}
verticalReaderState.snapToPage(pageToScroll)
} else {
val pageToScroll = verticalReaderState.currentPage
pagerState.scrollToPage(pageToScroll)
@ -4124,9 +4130,6 @@ fun PdfViewerScreen(
Box(
modifier = Modifier
.fillMaxSize()
.padding(
top = verticalHeaderHeight, bottom = verticalFooterHeight
)
) {
when {
isLoadingDocument -> {
@ -4605,8 +4608,8 @@ fun PdfViewerScreen(
}
DisplayMode.VERTICAL_SCROLL -> {
val headerHeight = 0.dp
val footerHeight = 0.dp
val headerHeight = verticalHeaderHeight
val footerHeight = verticalFooterHeight
val currentSelectedTool by rememberUpdatedState(selectedTool)
val currentStrokeColorState by rememberUpdatedState(