From 230e538e41360f2018db9a8b5274402d0b3200b6 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 9 Mar 2026 02:25:18 +0100 Subject: generalize Item from Text to Textual --- src/TextViewport/Viewport/Viewport.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/TextViewport/Viewport/Viewport.hs') diff --git a/src/TextViewport/Viewport/Viewport.hs b/src/TextViewport/Viewport/Viewport.hs index e6fdaab..65f48e4 100644 --- a/src/TextViewport/Viewport/Viewport.hs +++ b/src/TextViewport/Viewport/Viewport.hs @@ -10,7 +10,7 @@ data Viewport = Viewport , vpOffset :: !Int } deriving (Show) -mkViewport :: Int -> Int -> RenderState -> Viewport +mkViewport :: Int -> Int -> RenderState a -> Viewport mkViewport width height rs = alignBottom rs Viewport { vpWidth = width @@ -19,7 +19,7 @@ mkViewport width height rs = } -- any function that sets vpOffset and can overshoot should use clampViewport -clampViewport :: RenderState -> Viewport -> Viewport +clampViewport :: RenderState a -> Viewport -> Viewport clampViewport rs vp = let total = RenderState.rsLineCount rs maxOff = max 0 (total - vpHeight vp) @@ -48,7 +48,7 @@ alignTop :: Viewport -> Viewport alignTop vp = vp { vpOffset = 0 } -alignBottom :: RenderState -> Viewport -> Viewport +alignBottom :: RenderState a -> Viewport -> Viewport alignBottom rs vp = let total = RenderState.rsLineCount rs off = max 0 (total - vpHeight vp) -- cgit v1.2.3