changeset 33336:5a884e88d122

maint: Merge stable to default.
author Markus Mützel <markus.muetzel@gmx.de>
date Fri, 05 Apr 2024 17:19:32 +0200
parents 000e4454fbcc (current diff) d624140ffd1b (diff)
children 714c6d2e253e
files
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/image/getframe.m	Fri Apr 05 15:22:40 2024 +0200
+++ b/scripts/image/getframe.m	Fri Apr 05 17:19:32 2024 +0200
@@ -114,11 +114,12 @@
     set (hf, "units", units)
   end_unwind_protect
 
+  dpr = get (hf, "__device_pixel_ratio__");
   i1 = max (floor (pos(1)), 1);
-  i2 = min (ceil (pos(1)+pos(3)-1), columns (cdata));
+  i2 = min (ceil ((pos(1)+pos(3)-1)*dpr), columns (cdata));
   idxx = i1:i2;
   i1 = max (floor (pos(2)), 1);
-  i2 = min (ceil (pos(2)+pos(4)-1), rows (cdata));
+  i2 = min (ceil ((pos(2)+pos(4)-1)*dpr), rows (cdata));
   idxy = fliplr (rows (cdata) - (i1:i2) + 1);
 
   frame = struct ("cdata", cdata(idxy,idxx,:), "colormap", []);