diff options
author | Canop <cano.petrole@gmail.com> | 2020-11-27 16:56:59 +0100 |
---|---|---|
committer | Canop <cano.petrole@gmail.com> | 2020-11-27 16:56:59 +0100 |
commit | 169dd754ade29cbfe2af9750224d5d6c5debdd6d (patch) | |
tree | 0fcbccddadc7f5e8de1521cf5b2ac13c872443af /src/image/image_view.rs | |
parent | 527df68c7844a720773d0560aa0ccdc333207c78 (diff) |
image preview centered in both directionskitty
Also switching kitty image transmission to chunks
to allow remote brooting
Diffstat (limited to 'src/image/image_view.rs')
-rw-r--r-- | src/image/image_view.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/image/image_view.rs b/src/image/image_view.rs index 4156064..ef9f5de 100644 --- a/src/image/image_view.rs +++ b/src/image/image_view.rs @@ -115,6 +115,12 @@ impl ImageView { debug_assert!(width <= area.width as u32); let mut double_line = DoubleLine::new(width as usize, con.true_colors); let mut y = area.top; + let img_top_offset = (area.height - (height/2) as u16)/2; + for _ in 0..img_top_offset { + w.queue(cursor::MoveTo(area.left, y))?; + fill_bg(w, area.width as usize, bg)?; + y += 1; + } let margin = area.width as usize - width as usize; let left_margin = margin / 2; let right_margin = margin - left_margin; |