Skip to content

fix: Before側クリックのズーム位置を正しく計算する - #1055

Closed
haranishi wants to merge 18 commits into
storytold:mainfrom
haranishi:fix/1035-before-after-click-zoom
Closed

haranishi wants to merge 18 commits into
storytold:mainfrom
haranishi:fix/1035-before-after-click-zoom

Conversation

@haranishi

@haranishi haranishi commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Before/Afterを左右・上下に並べたとき、Before側をクリックするとズーム中心がずれる不具合を修正します。

写真上のクリック座標の計算にAfter側の矩形を使っていたため、Before側の位置が画像の端に丸められていました。クリックした側の画像と表示領域を、色のサンプル取得と同様にズーム操作にも渡します。

Refs #1035

このPRではクリックによる位置ずれを検証します。報告のGIFにある描画アーティファクト全体の解消は未確認です。

検証:

  • 回帰テストは修正前に失敗(横63%のクリックが0%になる)、修正後に成功。左右・上下の2配置でBefore側・After側の計4ケースを確認。
  • ズーム・Before/After関連49テスト成功、既存の1件はignored。
  • デモ写真を使う実UIのヘッドレス確認: 左右・上下の両配置でBefore側・After側をクリックし、4ケースとも選んだ位置を中心に100%へズーム。比較表示の維持と画面も確認。

CI修正 #1159 をこのブランチへ取り込みました。既存修正のコミット履歴を保持し、先に #1159 がmainへ入ると、このPRの機能差分だけを確認できます。

更新ブランチの実ファイルで、macOS / Rust 1.99・CJKフォントあり・通常の並列実行の cargo xtask ci が全8項目通過しました。一時パッチやテストの直列化は使っていません。

CI修正 #1159 は既存の3OS・GPU CI追加PR #1148 とWindows修正 #1052 を統合しています。この最終構成を含む更新ブランチで、上記の全8項目を再検証して通過しました。

更新コミット 4a5ecc77 のGitHub Actionsは、Linux・macOS・Windowsの全体テストとGPU比較、パッケージングの全5チェックを通過しました。3OS・GPU CI / パッケージングCI

nledford and others added 18 commits October 11, 2026 10:45
… the menu passes on_exit its second argument)

88e4188 gave eframe the glow feature, which gives App::on_exit a GL
context parameter. The trait impl was updated; the call in the
macOS-only Quit path was not, so the app did not compile on macOS. It
passes None: nothing in on_exit uses the context.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…no /bin/true)

The spawning thread ran /bin/true, which is /usr/bin/true on macOS, so
it never spawned a child and the test failed there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…(clippy 1.99 chunks_exact_to_as_chunks)

Item 4 of storytold#989. Same elements and the same ignored remainder as chunks_exact(3),
checked on lengths 0-9 in a scratch file; the 13 spots tests pass and clippy over
the workspace without the desktop app package is clean under -D warnings. Items
1-3 of storytold#989 (the macOS app build, the /bin/true lock test, eleven engine tests)
are not touched here.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…TF-8 names where the file system refuses them (item 3, one of eleven)

APFS refuses names that are not valid UTF-8 (EILSEQ, os error 92), so the test's
create_dir_all(...).unwrap() panicked on macOS. The test now probes once with a
\xff folder; where that fails, the non-UTF-8 folder case and the non-UTF-8 entry
are skipped and the catalog-folder and symlink cases still run on a plain-named
folder. Where the probe succeeds (Linux, FreeBSD) the test is unchanged.

Run on macOS (case-insensitive APFS, rustc 1.99.0): the five tests in
tests_lightroom_folder pass, cargo fmt is clean, and clippy over lightcraft-engine
with --all-targets is clean. The ten sidecar tests of item 3 are not touched.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…-insensitive volume (item 3, ten of eleven)

The tests were written for a case-sensitive disk. rename.rs sidecars() offers both
.XMP and .xmp per naming and keeps those that exist; on case-insensitive APFS
a.XMP "exists" for a file stored as a.xmp, so the code renames a.XMP while the
fault injectors (Faults twice, PartialRename) compared exact paths with the
lowercase one: the injected failure never fired and the rename the tests expect
to be refused succeeded.

Fault injectors now match by same_path_or_file (equal path, or the same file by
identity); two assertions that compared an exact spelling use same_path_for_volume
(equal, or equal ignoring ASCII case on a case-insensitive volume), and one that
required the lowercase packet to be absent is skipped there, where both spellings
are one file. Helpers live in tests_xmp.rs. Production code is not touched.

Run with rustc 1.99.0 on macOS: case-insensitive APFS, the ten failed before and
pass now; case-sensitive APFS (a disk image), the original tests pass and so do
these. All 13 sidecar::tests_repair tests pass on both. cargo fmt is clean and
clippy over lightcraft-engine with --all-targets is clean. Not touched: the
.xmp -> .XMP spelling change on rename, and the Lightroom folder test (its own PR).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…row (Add to Apple Photos, 876 pt)

export_dialog_is_unchanged_in_a_tall_window expected 846 pt on every platform.
a6431c1 (add exported files to Apple Photos, storytold#236) put a macOS-only checkbox at
the end of the dialog, so on macOS it is 876 pt tall at 1600x1000 (measured:
[[492 62] - [1107.2 938]]). The test failed on macOS on upstream main (76b5377)
with no other change; it is unchanged on other platforms.

Run on macOS (rustc 1.99.0): the five tests in tests_dialog_fit pass, cargo fmt
is clean, clippy over lightcraft-ui-egui with --all-targets is clean. Not run on
Linux or FreeBSD, where the expectation stays 846.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…n one line)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…me/sidecar tests

20 engine tests failed on Windows on clean main. Three real bugs on
case-insensitive volumes (Windows, default macOS APFS) caused most of them:

- Renaming a photo probed `a.XMP` before `a.xmp`. On a case-insensitive
  volume the upper-case spelling "exists" when only `a.xmp` is there, so the
  sidecar was moved as `Trip.XMP` (and its retained-packet record was taken
  under the wrong spelling). Upper-case candidates are now used only when the
  folder lists them exactly (new `MoveFs::listed`).
- `RealFs::same_file` on Windows (no file id in std) depended on argument
  order: `same_file("Trip.XMP", "Trip.xmp")` was false when `Trip.xmp` is the
  real entry, so saving after a partial rename reported a phantom collision.
  It is now symmetric, and also requires the names to differ only by case
  (two different files with equal size and mtime were "the same").
- Saving metadata picked the sidecar spelling by `is_file()`, lower case
  first, so the atomic write renamed an existing `Trip.XMP` to `Trip.xmp`.
  The spelling the folder lists now wins.

The rest were fixtures: FakeFs fault paths, catalog paths and expected
paths spelled with `/` while the code joins with the host separator.

Regression tests: case_insensitive_renames_keep_each_sidecars_spelling
(FakeFs, every platform; fails without the fix) and
same_file_spellings_are_symmetric_on_windows. Linux behaviour unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
desktop_exec treats a freedesktop Exec path as absolute when it starts
with '/' on every platform (Path::is_absolute wants a drive letter on
Windows); fill_box uses as_chunks (clippy::chunks_exact_to_as_chunks);
LibraryLock::descriptor_copy is cfg(all(test, unix)) like its only test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… tests

`Gpu::new` refuses software adapters (llvmpipe / lavapipe, WARP): the CPU
pipeline is faster. CI runners have nothing else, so the CPU <-> GPU
equivalence tests have always skipped there.

`LIGHTCRAFT_GPU_ALLOW_SOFTWARE=1` admits them. The app never sets it and
the default is unchanged. On lavapipe all 134 compared renders stay within
max 1 LSB, mean <= 0.0003 LSB, the same as Metal on an M4 Pro.

The two big-source window tests used a 24 MP (288 MB) source. That is over
lavapipe's 128 MiB storage binding (the WebGPU default), so geometry ran on
the CPU and nothing was uploaded: one test failed and the other passed
without checking anything. They now use 3200 x 3200 (117 MiB): above
RETAIN_SOURCE_BYTES, so the source is still shared, and uploaded on every
adapter.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On every pull request and push to main, on standard GitHub-hosted runners:
Linux runs `cargo xtask ci`. macOS and Windows run clippy and
`cargo test --workspace --no-fail-fast`, the steps whose result depends on
the platform.

All three then run the GPU test targets on lavapipe, Metal and WARP. That
step fails if the tests still skip for lack of an adapter.

The dependency cache is saved from main only. The workflow uses only the
actions and pins already in release.yml.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…platforms

ci.yml exists, but main does not pass it yet. The storytold#989 fixes and the
Windows ones (storytold#1052) are still outstanding, so the entry stays open:
6-12 h -> 2-4 h. Headline numbers are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@haranishi
haranishi marked this pull request as ready for review October 12, 2026 02:09
@haranishi

Copy link
Copy Markdown
Contributor Author

@bflatastic Could you review this PR?

The latest head 4a5ecc77 passed all 5 checks, including the Linux/macOS/Windows workspace tests, GPU tests on lavapipe/Metal/WARP, and packaging. CI run.

This PR includes the shared CI fixes from #1159; please review that integration first so this PR can be reviewed as its feature change.

Copilot AI balanced review requested due to automatic review settings October 12, 2026 02:09

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@aiongg

aiongg commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Closing: on main since 3d80ed5 (#1742), a click in the Before view zooms on that view's own pane, the same fix as here.

@aiongg aiongg closed this Oct 21, 2026
bogusyogi pushed a commit to Orthic-Labs/ember that referenced this pull request Oct 25, 2026
…ct two rationales, one anchor and the table totals

The crates/video/src/sidecar.rs exception cited bogusyogi/rightkit#1015 and said
ResolveOptions::bundle_dir is on RightKit main. storytold#1015 was closed as not planned on
2026-10-24 (the published rightkit-ffmpeg 0.2.10 already takes caller-named paths through
verify_bundled_ffmpeg and ResolutionRequest.bundled_paths) and no bundle_dir exists in the
owner source. The entry now names the Ember decision issue #267 (keep or drop the video
crate) and says the owner needs no change. The cut-list row says the same.

The rk_logs.rs rationale named Ember's RotatingTextWriter (the egui host's file writer);
the desktop log path is a JsonlStore shared with a log-crate bridge. Reworded in the
exception and the cut-list row; the owner issues stay storytold#1027 and storytold#1055.

switches.json: the LOCALAPPDATA anchor pointed five lines above the read in
right-release.config.mjs (49, now 54).

cut-list.md: apps/lightcraft-desktop src is 2,509 lines after e7445ed (the table was
summed at 2,496), so the keep (product) and Rust tree totals are 16,476 and 331,748 src.

Claude-Session: https://claude.ai/code/session_01K2MsXFDhGU3dPG949WGWAa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants