Skip to content

Instantly share code, notes, and snippets.

@15cm
Last active October 22, 2023 09:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 15cm/ee723a4fc3d54d4a95c08f11928d3f6f to your computer and use it in GitHub Desktop.
Save 15cm/ee723a4fc3d54d4a95c08f11928d3f6f to your computer and use it in GitHub Desktop.
Yazi ueberzugpp scale patch
diff --git a/adaptor/src/ueberzug.rs b/adaptor/src/ueberzug.rs
index 27d891b..24f5e31 100644
--- a/adaptor/src/ueberzug.rs
+++ b/adaptor/src/ueberzug.rs
@@ -47,10 +47,10 @@ impl Ueberzug {
if let Some((path, rect)) = cmd {
let s = format!(
r#"{{"action":"add","identifier":"yazi","x":{},"y":{},"max_width":{},"max_height":{},"path":"{}"}}{}"#,
- rect.x,
- rect.y,
- rect.width,
- rect.height,
+ (rect.x + 1) / 2,
+ (rect.y + 1) / 2,
+ (rect.width + 1) / 2,
+ (rect.height + 1) / 2,
path.to_string_lossy(),
"\n"
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment