kopia lustrzana https://github.com/hholzgra/ocitysmap
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
rodzic
92bbb4b713
commit
bec0a07f94
|
|
@ -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
|
||||
|
|
|
|||
Ładowanie…
Reference in New Issue