HiDPI monitors with scaling make cropping region incorrect
When using HiDPI monitors with scaling, elisp functions about frame size (e.g.
frame-geometry) reports position as scaled down value which makes images incorrectly cropped (because of function
For example, the function
1235x701+22+75 in my computer where the result should be
It would be great if
- I can set arguments to
-croparguments. For example if I can do something like this:
(setq gif-screencast-cropping-args (("-resize" "50%") . nil)) ;; gif-screencast-cropping-args is a cons cell with car as prev args and cdr as trailing args ;; Is it available to do this while preserving backwards compatibility?
- or I can set a variable for scaling:
(setq gif-screencast-scale 0.5)
I would actually appreciate the first solution as it's more general...
Currently my go-to solution is an advice like this:
(advice-add #'gif-screencast--cropping-region :around (lambda (oldfun &rest r) (apply #'format "%dx%d+%d+%d" (mapcar (lambda (x) (* 2 (string-to-number x))) (split-string (apply oldfun r) "[+x]")))))