Commit: 292809b71b965608555a0f3ada9673da5ad990c6
Parent: 29c81020b29bd7ca0521d84753feca4fe72dbfae
Author: Randy Palamar
Date: Sat, 22 May 2021 19:01:24 -0600
use mpv builtins for image panning/zooming
Diffstat:
3 files changed, 11 insertions(+), 17 deletions(-)
diff --git a/.config/mpv/input.conf b/.config/mpv/input.conf
@@ -8,8 +8,8 @@ K add sub-font-size 1
h script-binding chapter_prev
l script-binding chapter_next
-r script-message rotate-video 90
-R script-message rotate-video -90
+r cycle-values video-rotate "90" "180" "270" "no"
+R cycle-values video-rotate "no" "270" "180" "90"
y cycle-values video-unscaled "yes" "no"
@@ -17,8 +17,12 @@ y cycle-values video-unscaled "yes" "no"
F1 cycle stop-screensaver
-MBTN_LEFT {images} script-binding drag-to-pan
-MBTN_MID {images} set video-pan-x 0; set video-pan-y 0; set video-zoom 0
-MBTN_RIGHT {images} script-binding pan-follows-cursor
-MOUSE_BTN3 {images} script-message cursor-centric-zoom 0.1
-MOUSE_BTN4 {images} script-message cursor-centric-zoom -0.1
+k {images} repeatable add video-zoom 0.1
+j {images} repeatable add video-zoom -0.1
+
+up {images} repeatable add video-pan-y +0.05
+down {images} repeatable add video-pan-y -0.05
+left {images} repeatable add video-pan-x +0.05
+right {images} repeatable add video-pan-x -0.05
+
+enter {images} set video-pan-x 0; set video-pan-y 0; set video-zoom 0
diff --git a/.config/mpv/script-opts/image_positioning.conf b/.config/mpv/script-opts/image_positioning.conf
@@ -1,8 +0,0 @@
-# size of the margins with drag-to-pan
-drag_to_pan_margin=0
-drag_to_pan_move_if_full_view=no
-
-# size of the margins with pan-follows-cursor
-pan_follows_cursor_margin=0
-# whether pan-follows-cursor should pan when the entire image is visible
-pan_follows_cursor_move_if_full_view=no
diff --git a/.config/mpv/scripts/image-positioning.lua b/.config/mpv/scripts/image-positioning.lua
@@ -1 +0,0 @@
-mpv-image-viewer/scripts/image-positioning.lua
-\ No newline at end of file