Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 25, 2026

ユーザーがカーソル周辺のポップアップも翻訳対象にできるよう、マウス位置翻訳の当たり判定範囲をピクセル単位で拡張できる必要がありました。翻訳対象ごとに範囲を指定できるようにすることで、ゲームごとの表示レイアウトに対応します。

  • 設定/UI
    • 翻訳対象ごとの「カーソル当たり判定拡張(px)」設定を追加
    • リソース文言を追加し、設定画面に反映
  • ヒットテスト
    • オーバーレイの判定矩形を指定ピクセル分だけ膨張させて判定
var r = new Rect(rect.X * scale, rect.Y * scale, rect.Width * scale, rect.Height * scale);
r.Inflate(padding, padding);
return r.Contains(pos) ? Visibility.Visible : Visibility.Collapsed;
Original prompt

This section details on the original issue you should resolve

<issue_title>マウスポインター位置のテキストのみ翻訳する機能の範囲選択</issue_title>
<issue_description>特定のゲームではカーソルを合わせたときにその周辺にポップアップが表示されます。
そのポップアップ内容までを翻訳対象としたいため、マウスポインター位置のテキストのみ翻訳する機能に、カーソル位置からの翻訳対象範囲を指定できるようにしてほしいです</issue_description>

<agent_instructions>マウスカーソル位置でテキスト矩形の表示切替する機能の当たり判定を設定で広げるようにする。
広げる当たり判定の値はピクセル値で指定する。値は翻訳対象ごとの設定にする。</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@Freeesia なるほど。確かに便利そうですね。 対応しようと思います。

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

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
Copilot AI requested a review from Freeesia January 25, 2026 07:35
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.

マウスポインター位置のテキストのみ翻訳する機能の範囲選択

2 participants