changeset 29443:f2bd8ea1c79c

maint: merge stable to default.
author Markus Mützel <markus.muetzel@gmx.de>
date Mon, 15 Mar 2021 18:55:26 +0100
parents 4a516dce916c (current diff) 3a27122022f7 (diff)
children be09ae42ba96
files scripts/plot/util/private/__print_parse_opts__.m
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/plot/util/private/__print_parse_opts__.m	Mon Mar 15 02:11:02 2021 -0400
+++ b/scripts/plot/util/private/__print_parse_opts__.m	Mon Mar 15 18:55:26 2021 +0100
@@ -490,6 +490,15 @@
 
   if (arg_st.formatted_for_printing)
     arg_st.ghostscript.resolution = [];
+
+    ## Warn if the figure is too large for the selected paper size
+    if (any (papersize_points < (arg_st.canvas_size + paperposition(1:2)))
+        || any (paperposition(1:2) < 0))
+      warning ("Octave:print:figure-too-large", ...
+               ['print: given the current "paperposition" and ', ...
+                '"papersize" properties, the figure is too large ', ...
+                "and will be cropped to fit on the output page."]);
+    endif
   else
     arg_st.ghostscript.papersize = "";
     arg_st.ghostscript.pageoffset = [0, 0];