Skip to content

Commit

Permalink
Fix scaled height
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaunLawrie authored Dec 7, 2023
1 parent 0207ff5 commit 09c1dd7
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,16 @@ function Get-SpectreImageExperimental {
}
}

0..$scaledHeight | Foreach-Object {
Write-host
}
$terminalHeight = $Host.UI.RawUI.WindowSize.Height
$imageRowHeight = [int]($scaledHeight / 2)
$topLeft = $Host.UI.RawUI.CursorPosition
$topLeft.Y = $topLeft.Y - $scaledHeight
if($imageRowHeight -le $terminalHeight) {
1..$imageRowHeight | Foreach-Object {
Write-host
}
$topLeft = $Host.UI.RawUI.CursorPosition
$topLeft.Y = $topLeft.Y - $imageRowHeight
}
$loopIterations = 0
[Console]::CursorVisible = $false
do {
Expand Down

0 comments on commit 09c1dd7

Please sign in to comment.