@june24/expo-pdf-reader 0.1.18 → 0.1.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -405,13 +405,8 @@ class ExpoPdfReaderView(context: Context, appContext: AppContext) : ExpoView(con
405
405
 
406
406
  override fun onSizeChanged(w: Int, h: Int, oldW: Int, oldH: Int) {
407
407
  super.onSizeChanged(w, h, oldW, oldH)
408
- if (w > 0 && pdfRenderer != null) {
409
- if (w != oldW) {
410
- pageHeights.clear()
411
- }
412
- if (pageHeights.isEmpty()) {
413
- renderPdf()
414
- }
408
+ if (w > 0 && pdfRenderer != null && pageHeights.isEmpty()) {
409
+ renderPdf()
415
410
  }
416
411
  }
417
412
 
@@ -619,7 +614,6 @@ class ExpoPdfReaderView(context: Context, appContext: AppContext) : ExpoView(con
619
614
  draggingPageIndex = -1
620
615
  dragStartBounds = null
621
616
  dragStartTouch = null
622
- renderJob?.cancel()
623
617
  }
624
618
 
625
619
  private fun renderPdf() {
@@ -636,8 +630,7 @@ class ExpoPdfReaderView(context: Context, appContext: AppContext) : ExpoView(con
636
630
  updateVisiblePages()
637
631
  return
638
632
  }
639
- renderJob?.cancel()
640
- renderJob = scope.launch {
633
+ scope.launch {
641
634
  val w = width.coerceAtLeast(1)
642
635
  val result = withContext(Dispatchers.Default) {
643
636
  (0 until renderer.pageCount).map { i ->
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@june24/expo-pdf-reader",
3
- "version": "0.1.18",
3
+ "version": "0.1.19",
4
4
  "description": "A PDF reader for Expo apps with annotation and zoom controls",
5
5
  "homepage": "git@gitlab.com:june_241/expo-pdf-reader.git",
6
6
  "main": "build/index.js",