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);