Skip to content

Commit

Permalink
reduce code redundancy in preview_img
Browse files Browse the repository at this point in the history
  • Loading branch information
Euro committed Mar 7, 2021
1 parent 7f4d50d commit 8309b2a
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions ytfzf
Original file line number Diff line number Diff line change
Expand Up @@ -305,24 +305,20 @@ preview_img () {

thumb_width=$WIDTH
thumb_height=$((HEIGHT - 2))
#most common x, y positions
thumb_x=$(($TTY_COLS / 2 + 3))
thumb_y=10
case "$PREVIEW_SIDE" in
right)
thumb_y=10
thumb_x=$(($TTY_COLS / 2 + 3))
;;
left)
thumb_y=10
thumb_x=2
;;
top)
thumb_height=$((HEIGHT - 5))
thumb_y=2
thumb_x=$(($TTY_COLS / 2 + 3))
;;
bottom)
thumb_height=$((HEIGHT - 5))
thumb_y=$(($TTY_LINES / 2 + 3))
thumb_x=$(($TTY_COLS / 2 + 3))
;;
esac

Expand Down

0 comments on commit 8309b2a

Please sign in to comment.