Add per-target cursor hit test padding for mouse-position translation#570
Merged
Conversation
Co-authored-by: Freeesia <9002657+Freeesia@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add range selection for text translation at cursor position
Add per-target cursor hit test padding for mouse-position translation
Jan 25, 2026
キャプチャ画像の解像度基準のピクセル値であることを説明文言に明記 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
- 当たり判定の余白計算からキャプチャ解像度のスケールを除去し、WPF上のピクセル値(DIP)基準に変更 - 判定ロジックとプレビュー表示が同一の計算(TextOverlayVisibilityConverter.InflatePadding)を 共有するようにし、表示される範囲と実際の当たり判定を完全に一致させる - 設定画面のマウスポインター判定余白コントロールにフォーカスがある間、対象のオーバーレイ上で マウス位置にプレビュー矩形を表示する機能を追加 - 前回追加した「キャプチャ画像の解像度基準」という説明文言を撤回(全18言語) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
オーバーレイ上にマウス追従で表示する方式は、設定画面にフォーカスがある間は オーバーレイにマウスが存在しないため不適切だった。設定値コントロール(種類を 問わない)にフォーカスがある間、コントロール脇にPopupでプレビュー矩形を表示する 方式に変更する。 - OverlayTextsControl/OverlayMainWindow/MainViewModelBase/Generic.xaml: オーバーレイ側のプレビュー実装を削除しロールバック (MousePointerHitTestPaddingPreviewMessage, NullableToVisibilityConverter, PreviewHitTestSizeConverter, PreviewHitTestMarginConverter を削除) - SettingsPropertyGridFactory: MousePointerHitTestPaddingのコントロールに フォーカスがある間、TextOverlayVisibilityConverter.InflatePaddingで 実際の当たり判定と同じ計算をしたプレビュー矩形をPopup表示するように変更 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
コントロール脇に固定表示するPopup方式ではなく、フォーカスがある間マウス カーソル位置に追従してプレビュー矩形を描画するAdorner方式に変更する。 スライダーを操作している最中に判定範囲を視覚化したいという意図に合わせ、 マウスキャプチャ中でも追従できるようWindow単位でPreviewMouseMoveを監視する。 - MousePointerHitTestPaddingAdorner: AdornerLayerに追加し、 TextOverlayVisibilityConverter.InflatePaddingで実際の当たり判定と 同じ計算をした矩形をマウス位置中心に描画する - AttachMousePointerHitTestPaddingPreview: GotFocusでAdorner生成・ Window.PreviewMouseMove/PropertyChanged購読、LostFocusで解除 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
マウスポインター判定の余白を、矩形を単純に拡大する方式(四隅が直角に 広がる)から、矩形からの最短距離がpadding以内かどうかで判定する円形 (角丸/スタジアム形状)に変更する。あわせてMousePointerHitTestPaddingに Slidable属性を追加し、NumberBoxに加えてスライダーでも操作できるようにする。 - TextOverlayVisibilityConverter: InflatePadding(矩形拡大)を HitTest(距離ベースの円形判定)に置き換え - SettingsPropertyGridFactory: プレビューAdornerの描画をDrawRectangleから DrawEllipseに変更し、テキスト矩形が無い状態(サイズ0)での判定と 数学的に一致する「マウス位置中心・半径paddingの円」を表示する - AllSettingsViewModel: MousePointerHitTestPaddingのSpinnable属性を Slidable(0, 100, 1, 10, true, 1)に置き換え Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Freeesia
marked this pull request as ready for review
July 21, 2026 03:55
Owner
|
@copilot このブランチのマージ競合を解決してください。 |
Copilot stopped work on behalf of
Freeesia due to an error
July 21, 2026 03:56
Freeesia
approved these changes
Jul 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ユーザーがカーソル周辺のポップアップも翻訳対象にできるよう、マウス位置翻訳の当たり判定範囲をピクセル単位で拡張できる必要がありました。翻訳対象ごとに範囲を指定できるようにすることで、ゲームごとの表示レイアウトに対応します。
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.