mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-11-03 23:58:55 +01:00 
			
		
		
		
	Fix crash when tapping reader in long strip mode before RecyclerView is created
This commit is contained in:
		@@ -52,11 +52,15 @@ class WebtoonFrame(context: Context) : FrameLayout(context) {
 | 
			
		||||
        recycler?.getHitRect(recyclerRect) ?: return super.dispatchTouchEvent(ev)
 | 
			
		||||
        // Shrink the box to account for any rounding issues.
 | 
			
		||||
        recyclerRect.inset(1, 1)
 | 
			
		||||
 | 
			
		||||
        if (recyclerRect.right < recyclerRect.left || recyclerRect.bottom < recyclerRect.top) {
 | 
			
		||||
            return super.dispatchTouchEvent(ev)
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        ev.setLocation(
 | 
			
		||||
            ev.x.coerceIn(recyclerRect.left.toFloat(), recyclerRect.right.toFloat()),
 | 
			
		||||
            ev.y.coerceIn(recyclerRect.top.toFloat(), recyclerRect.bottom.toFloat()),
 | 
			
		||||
        )
 | 
			
		||||
 | 
			
		||||
        return super.dispatchTouchEvent(ev)
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user