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:
parent
a9c791120d
commit
9842aea9b1
4 changed files with 31 additions and 28 deletions
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue