[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Maposmatic-dev] [PATCH 22/22] multi-page: minor fixups for compatibili
From: |
Thomas Petazzoni |
Subject: |
[Maposmatic-dev] [PATCH 22/22] multi-page: minor fixups for compatibility with Gaël's work to remo ve the scaling |
Date: |
Fri, 30 Mar 2012 13:00:39 +0200 |
Signed-off-by: Thomas Petazzoni <address@hidden>
---
ocitysmap2/layoutlib/abstract_renderer.py | 2 +-
ocitysmap2/layoutlib/multi_page_renderer.py | 14 +++++---------
2 files changed, 6 insertions(+), 10 deletions(-)
diff --git a/ocitysmap2/layoutlib/abstract_renderer.py
b/ocitysmap2/layoutlib/abstract_renderer.py
index 713bf58..4f7083f 100644
--- a/ocitysmap2/layoutlib/abstract_renderer.py
+++ b/ocitysmap2/layoutlib/abstract_renderer.py
@@ -58,7 +58,7 @@ class Renderer:
# on the rendered map of a kilometer
DEFAULT_KM_IN_MM = 100
- def __init__(self, db, rc, tmpdir, street_index):
+ def __init__(self, db, rc, tmpdir, dpi, street_index):
"""
Create the renderer.
diff --git a/ocitysmap2/layoutlib/multi_page_renderer.py
b/ocitysmap2/layoutlib/multi_page_renderer.py
index df6cef6..7645ed1 100644
--- a/ocitysmap2/layoutlib/multi_page_renderer.py
+++ b/ocitysmap2/layoutlib/multi_page_renderer.py
@@ -65,8 +65,8 @@ class MultiPageRenderer(Renderer):
description = 'A multi-page layout.'
multipages = True
- def __init__(self, *args, **kwargs):
- Renderer.__init__(self, *args, **kwargs)
+ def __init__(self, db, rc, tmpdir, dpi, street_index):
+ Renderer.__init__(self, db, rc, tmpdir, dpi, street_index)
self._grid_legend_margin_pt = \
min(Renderer.GRID_LEGEND_MARGIN_RATIO * self.paper_width_pt,
@@ -204,7 +204,9 @@ class MultiPageRenderer(Renderer):
# Create one canvas for the current page
map_canvas = MapCanvas(self.rc.stylesheet,
- bb, graphical_ratio=None)
+ bb, self._usable_area_width_pt,
+ self._usable_area_height_pt, dpi,
+ extend_bbox_to_ratio=False)
map_canvas.add_shape_file(shade)
map_canvas.add_shape_file(grid_shape,
@@ -317,14 +319,8 @@ class MultiPageRenderer(Renderer):
ctx.translate(commons.convert_pt_to_dots(Renderer.PRINT_SAFE_MARGIN_PT),
commons.convert_pt_to_dots(Renderer.PRINT_SAFE_MARGIN_PT))
- ctx.save()
rendered_map = canvas.get_rendered_map()
- ctx.scale(commons.convert_pt_to_dots(self._usable_area_width_pt)
- / rendered_map.width,
- commons.convert_pt_to_dots(self._usable_area_height_pt)
- / rendered_map.height)
mapnik.render(rendered_map, ctx)
- ctx.restore()
# Render the page number
ctx.save()
--
1.7.4.1
- [Maposmatic-dev] [PATCH 12/22] indexlib: render page number as part of the street/amenity location, (continued)
- [Maposmatic-dev] [PATCH 12/22] indexlib: render page number as part of the street/amenity location, Thomas Petazzoni, 2012/03/30
- [Maposmatic-dev] [PATCH 15/22] indexlib: properly differentiate the page_number=None and page_number=0 cases, Thomas Petazzoni, 2012/03/30
- [Maposmatic-dev] [PATCH 13/22] multi-page: add in dex rendering with a new MultiPageStreetIndexRenderer cl ass, Thomas Petazzoni, 2012/03/30
- [Maposmatic-dev] [PATCH 11/22] multi-page: prepare data for index generation, Thomas Petazzoni, 2012/03/30
- [Maposmatic-dev] [PATCH 14/22] multi-page: remove multiple debugging outputs, Thomas Petazzoni, 2012/03/30
- [Maposmatic-dev] [PATCH 18/22] indexlib: add min_drawing_width() method, Thomas Petazzoni, 2012/03/30
- [Maposmatic-dev] [PATCH 19/22] MultiPageStreetIndexRenderer: remove debugging background rectangle, Thomas Petazzoni, 2012/03/30
- [Maposmatic-dev] [PATCH 16/22] multi-page: in the street index, start page numbering at 1, Thomas Petazzoni, 2012/03/30
- [Maposmatic-dev] [PATCH 21/22] MultiPageStreetIndexRenderer: automatically compute the number of columns, Thomas Petazzoni, 2012/03/30
- [Maposmatic-dev] [PATCH 20/22] MultiPageStreetIndexRenderer: reduce size of default font, Thomas Petazzoni, 2012/03/30
- [Maposmatic-dev] [PATCH 22/22] multi-page: minor fixups for compatibility with Gaël's work to remo ve the scaling,
Thomas Petazzoni <=
- [Maposmatic-dev] [PATCH 17/22] index for multi-page: improve page_number handling, Thomas Petazzoni, 2012/03/30
- Re: [Maposmatic-dev] Implementation of a multi-page renderer, Jeroen van Rijn, 2012/03/30
Re: [Maposmatic-dev] Implementation of a multi-page renderer, Thomas Petazzoni, 2012/03/30