Add a custom, fitted paper format

When returning the list of compatible paper sizes for the provided
bounding box, add a custom format that is exactly fitted to the bounding
box if the user doesn't want one of the preset paper sizes.

Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
stable
Maxime Petazzoni 2010-08-05 17:03:04 +02:00
rodzic 92bbb4b713
commit bec0a07f94
1 zmienionych plików z 5 dodań i 0 usunięć

Wyświetl plik

@ -259,6 +259,11 @@ class PlainRenderer(Renderer):
valid_sizes = filter(lambda (name,w,h):
paper_width_mm <= w and paper_height_mm <= h,
Renderer.PAPER_SIZES)
# Add a 'Custom' paper format to the list that perfectly matches the
# bounding box.
valid_sizes.append(('Custom', paper_width_mm, paper_height_mm))
return valid_sizes
# The renderers registry