Changeset - e0cf5e9351ce
[Not reviewed]
0 1 0
Branko Majic (branko) - 10 years ago 2013-11-28 23:30:38
branko@majic.rs
PYD-1: Fixed drawing of blocks (lower right coords have to be reduced by 1 to account for the edge).
1 file changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
pydenticon/__init__.py
Show inline comments
 
@@ -223,14 +223,14 @@ class Generator(object):
 
        for row, row_columns in enumerate(matrix):
 
            for column, cell in enumerate(row_columns):
 
                if cell:
 
                    # Set-up the coordinates for a block.
 
                    x1 = padding[2] + column * block_width
 
                    y1 = padding[0] + row * block_height
 
                    x2 = padding[2] + (column + 1) * block_width
 
                    y2 = padding[0] + (row + 1) * block_height
 
                    x2 = padding[2] + (column + 1) * block_width - 1
 
                    y2 = padding[0] + (row + 1) * block_height - 1
 

	
 
                    # Draw the rectangle.
 
                    draw.rectangle((x1, y1, x2, y2), fill=foreground)
 

	
 
        # Set-up a stream where image will be saved.
 
        stream = BytesIO()
0 comments (0 inline, 0 general)