Skip to content

Commit 84c9cf9

Browse files
A Norman (normanA Norman (norman
A Norman (norman
authored and
A Norman (norman
committed
Corrects issue #4 : Milestone text shifted
Shifted coordinate system from mm an cm to pixels.
1 parent bf7f4cd commit 84c9cf9

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

gantt/gantt.py

+11-7
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
"""
2828

2929
__author__ = 'Alexandre Norman (norman at xael.org)'
30-
__version__ = '0.4.3'
31-
__last_modification__ = '2015.11.24'
30+
__version__ = '0.4.4'
31+
__last_modification__ = '2015.11.25'
3232

3333
import codecs
3434
import datetime
@@ -41,7 +41,11 @@
4141

4242
try:
4343
import svgwrite
44-
from svgwrite import cm, mm
44+
# conversion from mm/cm to pixel is done by ourselve as firefox seems
45+
# to have a bug for big numbers...
46+
# 3.543307 is for conversion from mm to pt units !
47+
mm = 3.543307
48+
cm = 35.43307
4549
except ImportError:
4650
print("This program uses svgwrite. See : https://bitbucket.org/mozman/svgwrite/")
4751
sys.exit(1)
@@ -1480,10 +1484,10 @@ def _time_diff_d(e, s):
14801484
# 3.543307 is for conversion from mm to pt units !
14811485
svg.add(svgwrite.shapes.Polygon(
14821486
points=[
1483-
((x+5)*3.543307, (y+2)*3.543307),
1484-
((x+8)*3.543307, (y+5)*3.543307),
1485-
((x+5)*3.543307, (y+8)*3.543307),
1486-
((x+2)*3.543307, (y+5)*3.543307)
1487+
((x+5)*mm, (y+2)*mm),
1488+
((x+8)*mm, (y+5)*mm),
1489+
((x+5)*mm, (y+8)*mm),
1490+
((x+2)*mm, (y+5)*mm)
14871491
],
14881492
fill=color,
14891493
stroke=color,

org2gantt/org2gantt.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424

2525
__author__ = 'Alexandre Norman (norman at xael.org)'
26-
__version__ = '0.4.3'
26+
__version__ = '0.4.4'
2727
__last_modification__ = '2015.06.13'
2828

2929
import copy

setup.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
with open(path.join(here, 'README.txt'), encoding='utf-8') as f:
1414
long_description = f.read()
1515

16-
16+
import gantt
1717

1818
setup (
1919
name = 'python-gantt',
20-
version = '0.4.3',
20+
version = gantt.__version__,
2121
author = 'Alexandre Norman',
2222
author_email = 'norman@xael.org',
2323
license ='gpl-3.0.txt',

0 commit comments

Comments
 (0)