From 87e0c38a3c338d1e94c10fbb5704d32d771e9c87 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 5 Mar 2026 05:17:42 +0000 Subject: [PATCH 1/2] Initial plan From 90a8704d368b7121c6df0c5edc5fe315ca6fc05b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 5 Mar 2026 05:21:54 +0000 Subject: [PATCH 2/2] fix: address review feedback on docs, error messages, and unused variables Co-authored-by: TheJoeFin <7809853+TheJoeFin@users.noreply.github.com> --- Text-Grab/Utilities/GrabTemplateExecutor.cs | 8 ++++---- Text-Grab/Views/FullscreenGrab.xaml.cs | 8 ++------ 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/Text-Grab/Utilities/GrabTemplateExecutor.cs b/Text-Grab/Utilities/GrabTemplateExecutor.cs index 90b82141..52ead768 100644 --- a/Text-Grab/Utilities/GrabTemplateExecutor.cs +++ b/Text-Grab/Utilities/GrabTemplateExecutor.cs @@ -56,9 +56,9 @@ public static class GrabTemplateExecutor /// /// The template to execute. /// - /// The screen rectangle (in WPF units, pre-DPI-scaling applied by caller) - /// that bounds the user's selection. Template region ratios are applied to - /// this rectangle's width/height. + /// The screen rectangle in physical screen pixels that bounds the user's + /// selection. Template region ratios are applied to this rectangle's + /// width/height to derive each sub-region's capture bounds. /// /// The OCR language to use. Pass null to use the app default. public static async Task ExecuteTemplateAsync( @@ -363,7 +363,7 @@ public static List ValidateOutputTemplate( } if (!available.Contains(num)) - issues.Add($"Placeholder {{{{num}}}} references region {num} which does not exist."); + issues.Add($"Placeholder {{{num}}} references region {num} which does not exist."); referenced.Add(num); } diff --git a/Text-Grab/Views/FullscreenGrab.xaml.cs b/Text-Grab/Views/FullscreenGrab.xaml.cs index 92d4b375..787afee2 100644 --- a/Text-Grab/Views/FullscreenGrab.xaml.cs +++ b/Text-Grab/Views/FullscreenGrab.xaml.cs @@ -445,8 +445,8 @@ private void FullscreenGrab_KeyUp(object sender, KeyEventArgs e) /// /// Draws scaled template region overlays inside the current selection border. - /// Regions are scaled using UniformToFill semantics relative to the template's - /// reference image dimensions so they fill the selected area proportionally. + /// Each region's stored ratio coordinates are applied directly to the current + /// selection dimensions (stretch-to-fill), so both axes scale independently. /// private void UpdateTemplateRegionOverlays(double selLeft, double selTop, double selWidth, double selHeight) { @@ -465,10 +465,6 @@ private void UpdateTemplateRegionOverlays(double selLeft, double selTop, double if (selWidth < 4 || selHeight < 4) return; - // Stretch: scale each axis independently to fill the selection exactly - double scaleX = selWidth / template.ReferenceImageWidth; - double scaleY = selHeight / template.ReferenceImageHeight; - templateOverlayCanvas.Width = selWidth; templateOverlayCanvas.Height = selHeight; Canvas.SetLeft(templateOverlayCanvas, selLeft);