[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Maposmatic-dev] [PATCH 12/22] indexlib: render page number as part of t
From: |
Thomas Petazzoni |
Subject: |
[Maposmatic-dev] [PATCH 12/22] indexlib: render page number as part of the street/amenity location |
Date: |
Fri, 30 Mar 2012 13:00:29 +0200 |
Signed-off-by: Thomas Petazzoni <address@hidden>
---
ocitysmap2/indexlib/commons.py | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/ocitysmap2/indexlib/commons.py b/ocitysmap2/indexlib/commons.py
index 5a762f6..f327f30 100644
--- a/ocitysmap2/indexlib/commons.py
+++ b/ocitysmap2/indexlib/commons.py
@@ -141,6 +141,16 @@ class IndexItem:
baseline_y (int): Y axis coordinate of the baseline.
"""
+ if not self.location_str:
+ square_str = '???'
+ else:
+ square_str = self.location_str
+
+ if self.page_number:
+ location_str = "%d, %s" % (self.page_number, square_str)
+ else:
+ location_str = square_str
+
ctx.save()
if not rtl:
_, _, line_start = draw_utils.draw_text_left(ctx, pc, layout,
@@ -150,12 +160,12 @@ class IndexItem:
line_end, _, _ = draw_utils.draw_text_right(ctx, pc, layout,
fascent, fheight,
baseline_x, baseline_y,
- self.location_str or
'???')
+ location_str)
else:
_, _, line_start = draw_utils.draw_text_left(ctx, pc, layout,
fascent, fheight,
baseline_x,
baseline_y,
- self.location_str or
'???')
+ location_str)
line_end, _, _ = draw_utils.draw_text_right(ctx, pc, layout,
fascent, fheight,
baseline_x, baseline_y,
--
1.7.4.1
- [Maposmatic-dev] [PATCH 01/22] Initial version of a multi-page renderer, (continued)
- [Maposmatic-dev] [PATCH 01/22] Initial version of a multi-page renderer, Thomas Petazzoni, 2012/03/30
- [Maposmatic-dev] [PATCH 03/22] multi-page: add a shape file that greys out the overlayed area between pages, Thomas Petazzoni, 2012/03/30
- [Maposmatic-dev] [PATCH 06/22] multi-page: add grid and grid labels, Thomas Petazzoni, 2012/03/30
- [Maposmatic-dev] [PATCH 05/22] multi-page: differentiate overlap margin and grayed margin, Thomas Petazzoni, 2012/03/30
- [Maposmatic-dev] [PATCH 04/22] multi-page: show page number at the bottom of each page, Thomas Petazzoni, 2012/03/30
- [Maposmatic-dev] [PATCH 07/22] indexlib: add page_number to IndexItem, Thomas Petazzoni, 2012/03/30
- [Maposmatic-dev] [PATCH 02/22] coords: add BoundingBox::as_javascript() method, Thomas Petazzoni, 2012/03/30
- [Maposmatic-dev] [PATCH 08/22] indexlib: do not raise exception when index is empty, Thomas Petazzoni, 2012/03/30
- [Maposmatic-dev] [PATCH 09/22] indexlib: villages section is not of street type, Thomas Petazzoni, 2012/03/30
- [Maposmatic-dev] [PATCH 10/22] renderers: pass the db connection to the Renderer class constructor, Thomas Petazzoni, 2012/03/30
- [Maposmatic-dev] [PATCH 12/22] indexlib: render page number as part of the street/amenity location,
Thomas Petazzoni <=
- [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, 2012/03/30