fix: wrong intersection check in preview and spot rendering (#3736)

This commit is contained in:
三咲雅 misaki masa 2026-03-04 15:17:01 +08:00 committed by sxyazi
parent b92b576ce1
commit 9648d8a43b
No known key found for this signature in database
32 changed files with 265 additions and 229 deletions

View file

@ -1,8 +1,17 @@
[workspace] [workspace]
resolver = "2" resolver = "3"
members = [ "yazi-*" ] members = [ "yazi-*" ]
default-members = [ "yazi-fm", "yazi-cli" ] default-members = [ "yazi-fm", "yazi-cli" ]
[workspace.package]
edition = "2024"
version = "26.2.2"
license = "MIT"
authors = [ "sxyazi <sxyazi@gmail.com>" ]
homepage = "https://yazi-rs.github.io"
repository = "https://github.com/sxyazi/yazi"
rust-version = "1.92.0"
[profile.dev] [profile.dev]
debug = "line-tables-only" debug = "line-tables-only"

View file

@ -32,7 +32,7 @@
rev = self.shortRev or self.dirtyShortRev or "dirty"; rev = self.shortRev or self.dirtyShortRev or "dirty";
date = self.lastModifiedDate or self.lastModified or "19700101"; date = self.lastModifiedDate or self.lastModified or "19700101";
version = version =
(builtins.fromTOML (builtins.readFile ./yazi-fm/Cargo.toml)).package.version (builtins.fromTOML (builtins.readFile ./Cargo.toml)).workspace.package.version
+ "pre${builtins.substring 0 8 date}_${rev}"; + "pre${builtins.substring 0 8 date}_${rev}";
in in
{ {

View file

@ -1,12 +1,13 @@
[package] [package]
name = "yazi-actor" name = "yazi-actor"
version = "26.2.2" description = "Yazi actor model"
edition = "2024" version.workspace = true
license = "MIT" edition.workspace = true
authors = [ "sxyazi <sxyazi@gmail.com>" ] license.workspace = true
description = "Yazi actor model" authors.workspace = true
homepage = "https://yazi-rs.github.io" homepage.workspace = true
repository = "https://github.com/sxyazi/yazi" repository.workspace = true
rust-version.workspace = true
[lints] [lints]
workspace = true workspace = true

View file

@ -1,12 +1,13 @@
[package] [package]
name = "yazi-adapter" name = "yazi-adapter"
version = "26.2.2" description = "Yazi image adapter"
edition = "2024" version.workspace = true
license = "MIT" edition.workspace = true
authors = [ "sxyazi <sxyazi@gmail.com>" ] license.workspace = true
description = "Yazi image adapter" authors.workspace = true
homepage = "https://yazi-rs.github.io" homepage.workspace = true
repository = "https://github.com/sxyazi/yazi" repository.workspace = true
rust-version.workspace = true
[lints] [lints]
workspace = true workspace = true

View file

@ -1,12 +1,13 @@
[package] [package]
name = "yazi-binding" name = "yazi-binding"
version = "26.2.2" description = "Yazi Lua bindings"
edition = "2024" version.workspace = true
license = "MIT" edition.workspace = true
authors = [ "sxyazi <sxyazi@gmail.com>" ] license.workspace = true
description = "Yazi Lua bindings" authors.workspace = true
homepage = "https://yazi-rs.github.io" homepage.workspace = true
repository = "https://github.com/sxyazi/yazi" repository.workspace = true
rust-version.workspace = true
[lints] [lints]
workspace = true workspace = true

View file

@ -1,12 +1,13 @@
[package] [package]
name = "yazi-boot" name = "yazi-boot"
version = "26.2.2" description = "Yazi bootstrapper"
edition = "2024" version.workspace = true
license = "MIT" edition.workspace = true
authors = [ "sxyazi <sxyazi@gmail.com>" ] license.workspace = true
description = "Yazi bootstrapper" authors.workspace = true
homepage = "https://yazi-rs.github.io" homepage.workspace = true
repository = "https://github.com/sxyazi/yazi" repository.workspace = true
rust-version.workspace = true
[lints] [lints]
workspace = true workspace = true

View file

@ -1,12 +1,13 @@
[package] [package]
name = "yazi-build" name = "yazi-build"
version = "26.2.2" description = "Yazi build system"
edition = "2024" version.workspace = true
license = "MIT" edition.workspace = true
authors = [ "sxyazi <sxyazi@gmail.com>" ] license.workspace = true
description = "Yazi build system" authors.workspace = true
homepage = "https://yazi-rs.github.io" homepage.workspace = true
repository = "https://github.com/sxyazi/yazi" repository.workspace = true
rust-version.workspace = true
[lints] [lints]
workspace = true workspace = true

View file

@ -1,12 +1,13 @@
[package] [package]
name = "yazi-cli" name = "yazi-cli"
version = "26.2.2" description = "Yazi command-line interface"
edition = "2024" version.workspace = true
license = "MIT" edition.workspace = true
authors = [ "sxyazi <sxyazi@gmail.com>" ] license.workspace = true
description = "Yazi command-line interface" authors.workspace = true
homepage = "https://yazi-rs.github.io" homepage.workspace = true
repository = "https://github.com/sxyazi/yazi" repository.workspace = true
rust-version.workspace = true
[lints] [lints]
workspace = true workspace = true

View file

@ -1,12 +1,13 @@
[package] [package]
name = "yazi-codegen" name = "yazi-codegen"
version = "26.2.2" description = "Yazi code generator"
edition = "2024" version.workspace = true
license = "MIT" edition.workspace = true
authors = [ "sxyazi <sxyazi@gmail.com>" ] license.workspace = true
description = "Yazi code generator" authors.workspace = true
homepage = "https://yazi-rs.github.io" homepage.workspace = true
repository = "https://github.com/sxyazi/yazi" repository.workspace = true
rust-version.workspace = true
[lints] [lints]
workspace = true workspace = true

View file

@ -1,12 +1,13 @@
[package] [package]
name = "yazi-config" name = "yazi-config"
version = "26.2.2" description = "Yazi configuration file parser"
edition = "2024" version.workspace = true
license = "MIT" edition.workspace = true
authors = [ "sxyazi <sxyazi@gmail.com>" ] license.workspace = true
description = "Yazi configuration file parser" authors.workspace = true
homepage = "https://yazi-rs.github.io" homepage.workspace = true
repository = "https://github.com/sxyazi/yazi" repository.workspace = true
rust-version.workspace = true
[lints] [lints]
workspace = true workspace = true

View file

@ -1,12 +1,13 @@
[package] [package]
name = "yazi-core" name = "yazi-core"
version = "26.2.2" description = "Yazi core logic"
edition = "2024" version.workspace = true
license = "MIT" edition.workspace = true
authors = [ "sxyazi <sxyazi@gmail.com>" ] license.workspace = true
description = "Yazi core logic" authors.workspace = true
homepage = "https://yazi-rs.github.io" homepage.workspace = true
repository = "https://github.com/sxyazi/yazi" repository.workspace = true
rust-version.workspace = true
[lints] [lints]
workspace = true workspace = true

View file

@ -1,12 +1,13 @@
[package] [package]
name = "yazi-dds" name = "yazi-dds"
version = "26.2.2" description = "Yazi data distribution service"
edition = "2024" version.workspace = true
license = "MIT" edition.workspace = true
authors = [ "sxyazi <sxyazi@gmail.com>" ] license.workspace = true
description = "Yazi data distribution service" authors.workspace = true
homepage = "https://yazi-rs.github.io" homepage.workspace = true
repository = "https://github.com/sxyazi/yazi" repository.workspace = true
rust-version.workspace = true
[lints] [lints]
workspace = true workspace = true

View file

@ -1,12 +1,13 @@
[package] [package]
name = "yazi-emulator" name = "yazi-emulator"
version = "26.2.2" description = "Yazi terminal emulator database"
edition = "2024" version.workspace = true
license = "MIT" edition.workspace = true
authors = [ "sxyazi <sxyazi@gmail.com>" ] license.workspace = true
description = "Yazi terminal emulator database" authors.workspace = true
homepage = "https://yazi-rs.github.io" homepage.workspace = true
repository = "https://github.com/sxyazi/yazi" repository.workspace = true
rust-version.workspace = true
[lints] [lints]
workspace = true workspace = true

View file

@ -1,12 +1,13 @@
[package] [package]
name = "yazi-ffi" name = "yazi-ffi"
version = "26.2.2" description = "Yazi foreign function interface"
edition = "2024" version.workspace = true
license = "MIT" edition.workspace = true
authors = [ "sxyazi <sxyazi@gmail.com>" ] license.workspace = true
description = "Yazi foreign function interface" authors.workspace = true
homepage = "https://yazi-rs.github.io" homepage.workspace = true
repository = "https://github.com/sxyazi/yazi" repository.workspace = true
rust-version.workspace = true
[lints] [lints]
workspace = true workspace = true

View file

@ -1,12 +1,13 @@
[package] [package]
name = "yazi-fm" name = "yazi-fm"
version = "26.2.2" description = "Yazi file manager"
edition = "2024" version.workspace = true
license = "MIT" edition.workspace = true
authors = [ "sxyazi <sxyazi@gmail.com>" ] license.workspace = true
description = "Yazi file manager" authors.workspace = true
homepage = "https://yazi-rs.github.io" homepage.workspace = true
repository = "https://github.com/sxyazi/yazi" repository.workspace = true
rust-version.workspace = true
[lints] [lints]
workspace = true workspace = true

View file

@ -23,7 +23,7 @@ impl Widget for Preview<'_> {
for w in &lock.data { for w in &lock.data {
let rect = w.area().transform(|p| self.core.mgr.area(p)); let rect = w.area().transform(|p| self.core.mgr.area(p));
if win.intersects(rect) { if rect.intersection(win) == rect {
w.clone().render(rect, buf); w.clone().render(rect, buf);
} }
} }

View file

@ -17,7 +17,7 @@ impl Widget for Spot<'_> {
for w in &lock.data { for w in &lock.data {
let rect = w.area().transform(|p| self.core.mgr.area(p)); let rect = w.area().transform(|p| self.core.mgr.area(p));
if win.intersects(rect) { if rect.intersection(win) == rect {
w.clone().render(rect, buf); w.clone().render(rect, buf);
} }
} }

View file

@ -1,12 +1,13 @@
[package] [package]
name = "yazi-fs" name = "yazi-fs"
version = "26.2.2" description = "Yazi file system"
edition = "2024" version.workspace = true
license = "MIT" edition.workspace = true
authors = [ "sxyazi <sxyazi@gmail.com>" ] license.workspace = true
description = "Yazi file system" authors.workspace = true
homepage = "https://yazi-rs.github.io" homepage.workspace = true
repository = "https://github.com/sxyazi/yazi" repository.workspace = true
rust-version.workspace = true
[lints] [lints]
workspace = true workspace = true

View file

@ -1,12 +1,13 @@
[package] [package]
name = "yazi-macro" name = "yazi-macro"
version = "26.2.2" description = "Yazi macros"
edition = "2024" version.workspace = true
license = "MIT" edition.workspace = true
authors = [ "sxyazi <sxyazi@gmail.com>" ] license.workspace = true
description = "Yazi macros" authors.workspace = true
homepage = "https://yazi-rs.github.io" homepage.workspace = true
repository = "https://github.com/sxyazi/yazi" repository.workspace = true
rust-version.workspace = true
[lints] [lints]
workspace = true workspace = true

View file

@ -1,12 +1,13 @@
[package] [package]
name = "yazi-packing" name = "yazi-packing"
version = "26.2.2" description = "Yazi packing"
edition = "2024" version.workspace = true
license = "MIT" edition.workspace = true
authors = [ "sxyazi <sxyazi@gmail.com>" ] license.workspace = true
description = "Yazi packing" authors.workspace = true
homepage = "https://yazi-rs.github.io" homepage.workspace = true
repository = "https://github.com/sxyazi/yazi" repository.workspace = true
rust-version.workspace = true
[lints] [lints]
workspace = true workspace = true

View file

@ -1,12 +1,13 @@
[package] [package]
name = "yazi-parser" name = "yazi-parser"
version = "26.2.2" description = "Yazi command parser"
edition = "2024" version.workspace = true
license = "MIT" edition.workspace = true
authors = [ "sxyazi <sxyazi@gmail.com>" ] license.workspace = true
description = "Yazi command parser" authors.workspace = true
homepage = "https://yazi-rs.github.io" homepage.workspace = true
repository = "https://github.com/sxyazi/yazi" repository.workspace = true
rust-version.workspace = true
[lints] [lints]
workspace = true workspace = true

View file

@ -1,12 +1,13 @@
[package] [package]
name = "yazi-plugin" name = "yazi-plugin"
version = "26.2.2" description = "Yazi plugin system"
edition = "2024" version.workspace = true
license = "MIT" edition.workspace = true
authors = [ "sxyazi <sxyazi@gmail.com>" ] license.workspace = true
description = "Yazi plugin system" authors.workspace = true
homepage = "https://yazi-rs.github.io" homepage.workspace = true
repository = "https://github.com/sxyazi/yazi" repository.workspace = true
rust-version.workspace = true
[lints] [lints]
workspace = true workspace = true

View file

@ -1,12 +1,13 @@
[package] [package]
name = "yazi-proxy" name = "yazi-proxy"
version = "26.2.2" description = "Yazi event proxy"
edition = "2024" version.workspace = true
license = "MIT" edition.workspace = true
authors = [ "sxyazi <sxyazi@gmail.com>" ] license.workspace = true
description = "Yazi event proxy" authors.workspace = true
homepage = "https://yazi-rs.github.io" homepage.workspace = true
repository = "https://github.com/sxyazi/yazi" repository.workspace = true
rust-version.workspace = true
[lints] [lints]
workspace = true workspace = true

View file

@ -1,12 +1,13 @@
[package] [package]
name = "yazi-scheduler" name = "yazi-scheduler"
version = "26.2.2" description = "Yazi task scheduler"
edition = "2024" version.workspace = true
license = "MIT" edition.workspace = true
authors = [ "sxyazi <sxyazi@gmail.com>" ] license.workspace = true
description = "Yazi task scheduler" authors.workspace = true
homepage = "https://yazi-rs.github.io" homepage.workspace = true
repository = "https://github.com/sxyazi/yazi" repository.workspace = true
rust-version.workspace = true
[lints] [lints]
workspace = true workspace = true

View file

@ -1,12 +1,13 @@
[package] [package]
name = "yazi-sftp" name = "yazi-sftp"
version = "26.2.2" description = "Yazi SFTP client"
edition = "2024" authors = [ "AspectUnk", "sxyazi <sxyazi@gmail.com>" ]
license = "MIT" version.workspace = true
authors = [ "AspectUnk", "sxyazi <sxyazi@gmail.com>" ] edition.workspace = true
description = "Yazi SFTP client" license.workspace = true
homepage = "https://yazi-rs.github.io" homepage.workspace = true
repository = "https://github.com/sxyazi/yazi" repository.workspace = true
rust-version.workspace = true
[lints] [lints]
workspace = true workspace = true

View file

@ -1,13 +1,13 @@
[package] [package]
name = "yazi-shared" name = "yazi-shared"
version = "26.2.2" description = "Yazi shared library"
edition = "2024" version.workspace = true
license = "MIT" edition.workspace = true
authors = [ "sxyazi <sxyazi@gmail.com>" ] license.workspace = true
description = "Yazi shared library" authors.workspace = true
homepage = "https://yazi-rs.github.io" homepage.workspace = true
repository = "https://github.com/sxyazi/yazi" repository.workspace = true
rust-version = "1.92.0" rust-version.workspace = true
[lints] [lints]
workspace = true workspace = true

View file

@ -1,12 +1,13 @@
[package] [package]
name = "yazi-shim" name = "yazi-shim"
version = "26.2.2" description = "Yazi crate shims"
edition = "2024" version.workspace = true
license = "MIT" edition.workspace = true
authors = [ "sxyazi <sxyazi@gmail.com>" ] license.workspace = true
description = "Yazi crate shims" authors.workspace = true
homepage = "https://yazi-rs.github.io" homepage.workspace = true
repository = "https://github.com/sxyazi/yazi" repository.workspace = true
rust-version.workspace = true
[lints] [lints]
workspace = true workspace = true

View file

@ -1,12 +1,13 @@
[package] [package]
name = "yazi-term" name = "yazi-term"
version = "26.2.2" description = "Yazi terminal extensions"
edition = "2024" version.workspace = true
license = "MIT" edition.workspace = true
authors = [ "sxyazi <sxyazi@gmail.com>" ] license.workspace = true
description = "Yazi terminal extensions" authors.workspace = true
homepage = "https://yazi-rs.github.io" homepage.workspace = true
repository = "https://github.com/sxyazi/yazi" repository.workspace = true
rust-version.workspace = true
[lints] [lints]
workspace = true workspace = true

View file

@ -1,12 +1,13 @@
[package] [package]
name = "yazi-tty" name = "yazi-tty"
version = "26.2.2" description = "Yazi TTY access layer"
edition = "2024" version.workspace = true
license = "MIT" edition.workspace = true
authors = [ "sxyazi <sxyazi@gmail.com>" ] license.workspace = true
description = "Yazi TTY access layer" authors.workspace = true
homepage = "https://yazi-rs.github.io" homepage.workspace = true
repository = "https://github.com/sxyazi/yazi" repository.workspace = true
rust-version.workspace = true
[lints] [lints]
workspace = true workspace = true

View file

@ -1,12 +1,13 @@
[package] [package]
name = "yazi-vfs" name = "yazi-vfs"
version = "26.2.2" description = "Yazi virtual file system"
edition = "2024" version.workspace = true
license = "MIT" edition.workspace = true
authors = [ "sxyazi <sxyazi@gmail.com>" ] license.workspace = true
description = "Yazi virtual file system" authors.workspace = true
homepage = "https://yazi-rs.github.io" homepage.workspace = true
repository = "https://github.com/sxyazi/yazi" repository.workspace = true
rust-version.workspace = true
[lints] [lints]
workspace = true workspace = true

View file

@ -1,12 +1,13 @@
[package] [package]
name = "yazi-watcher" name = "yazi-watcher"
version = "26.2.2" description = "Yazi file watcher"
edition = "2024" version.workspace = true
license = "MIT" edition.workspace = true
authors = [ "sxyazi <sxyazi@gmail.com>" ] license.workspace = true
description = "Yazi file watcher" authors.workspace = true
homepage = "https://yazi-rs.github.io" homepage.workspace = true
repository = "https://github.com/sxyazi/yazi" repository.workspace = true
rust-version.workspace = true
[lints] [lints]
workspace = true workspace = true

View file

@ -1,12 +1,13 @@
[package] [package]
name = "yazi-widgets" name = "yazi-widgets"
version = "26.2.2" description = "Yazi user interface widgets"
edition = "2024" version.workspace = true
license = "MIT" edition.workspace = true
authors = [ "sxyazi <sxyazi@gmail.com>" ] license.workspace = true
description = "Yazi user interface widgets" authors.workspace = true
homepage = "https://yazi-rs.github.io" homepage.workspace = true
repository = "https://github.com/sxyazi/yazi" repository.workspace = true
rust-version.workspace = true
[lints] [lints]
workspace = true workspace = true