diff options
| author | tv <tv@krebsco.de> | 2026-03-09 03:35:50 +0100 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-03-09 03:35:50 +0100 |
| commit | a648d77052f04d4731d728fc317a0947b35a3ed5 (patch) | |
| tree | 2e125e5f3a0a5d29884dcb35e729523153e00a5c /src/TextViewport/Viewport/Viewport.hs | |
| parent | bff24914f21800719c99c80165a8c3a3759311e7 (diff) | |
Diffstat (limited to 'src/TextViewport/Viewport/Viewport.hs')
| -rw-r--r-- | src/TextViewport/Viewport/Viewport.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/TextViewport/Viewport/Viewport.hs b/src/TextViewport/Viewport/Viewport.hs index 65f48e4..36392c7 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 a -> Viewport +mkViewport :: Int -> Int -> RenderState a seg -> 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 a -> Viewport -> Viewport +clampViewport :: RenderState a seg -> 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 a -> Viewport -> Viewport +alignBottom :: RenderState a seg -> Viewport -> Viewport alignBottom rs vp = let total = RenderState.rsLineCount rs off = max 0 (total - vpHeight vp) |
