equal
deleted
inserted
replaced
23 # along with this program; if not, write to the Free Software |
23 # along with this program; if not, write to the Free Software |
24 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
24 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
25 |
25 |
26 |
26 |
27 from __future__ import absolute_import |
27 from __future__ import absolute_import |
|
28 from __future__ import division |
28 from types import TupleType |
29 from types import TupleType |
29 from copy import deepcopy |
30 from copy import deepcopy |
30 import os |
31 import os |
31 import re |
32 import re |
32 import datetime |
33 import datetime |
1937 instance.setlocalId(idx) |
1938 instance.setlocalId(idx) |
1938 translate_id[localId] = idx |
1939 translate_id[localId] = idx |
1939 |
1940 |
1940 x, y, width, height = bbox.bounding_box() |
1941 x, y, width, height = bbox.bounding_box() |
1941 if middle: |
1942 if middle: |
1942 new_pos[0] -= width / 2 |
1943 new_pos[0] -= width // 2 |
1943 new_pos[1] -= height / 2 |
1944 new_pos[1] -= height // 2 |
1944 else: |
1945 else: |
1945 new_pos = map(lambda x: x + 30, new_pos) |
1946 new_pos = map(lambda x: x + 30, new_pos) |
1946 if scaling[0] != 0 and scaling[1] != 0: |
1947 if scaling[0] != 0 and scaling[1] != 0: |
1947 min_pos = map(lambda x: 30 / x, scaling) |
1948 min_pos = map(lambda x: 30 / x, scaling) |
1948 minx = round(min_pos[0]) |
1949 minx = round(min_pos[0]) |