@@ -21,7 +21,7 @@ class HatchPatternBase:
2121
2222class HorizontalHatch (HatchPatternBase ):
2323 def __init__ (self , hatch , density ):
24- self .num_lines = ( hatch .count ('-' ) + hatch .count ('+' )) * density
24+ self .num_lines = int (( hatch .count ('-' ) + hatch .count ('+' )) * density )
2525 self .num_vertices = self .num_lines * 2
2626
2727 def set_vertices_and_codes (self , vertices , codes ):
@@ -38,7 +38,7 @@ def set_vertices_and_codes(self, vertices, codes):
3838
3939class VerticalHatch (HatchPatternBase ):
4040 def __init__ (self , hatch , density ):
41- self .num_lines = ( hatch .count ('|' ) + hatch .count ('+' )) * density
41+ self .num_lines = int (( hatch .count ('|' ) + hatch .count ('+' )) * density )
4242 self .num_vertices = self .num_lines * 2
4343
4444 def set_vertices_and_codes (self , vertices , codes ):
@@ -55,8 +55,8 @@ def set_vertices_and_codes(self, vertices, codes):
5555
5656class NorthEastHatch (HatchPatternBase ):
5757 def __init__ (self , hatch , density ):
58- self .num_lines = (hatch .count ('/' ) + hatch .count ('x' ) +
59- hatch .count ('X' )) * density
58+ self .num_lines = int ( (hatch .count ('/' ) + hatch .count ('x' ) +
59+ hatch .count ('X' )) * density )
6060 if self .num_lines :
6161 self .num_vertices = (self .num_lines + 1 ) * 2
6262 else :
@@ -74,8 +74,8 @@ def set_vertices_and_codes(self, vertices, codes):
7474
7575class SouthEastHatch (HatchPatternBase ):
7676 def __init__ (self , hatch , density ):
77- self .num_lines = (hatch .count ('\\ ' ) + hatch .count ('x' ) +
78- hatch .count ('X' )) * density
77+ self .num_lines = int ( (hatch .count ('\\ ' ) + hatch .count ('x' ) +
78+ hatch .count ('X' )) * density )
7979 self .num_vertices = (self .num_lines + 1 ) * 2
8080 if self .num_lines :
8181 self .num_vertices = (self .num_lines + 1 ) * 2
@@ -100,8 +100,8 @@ def __init__(self, hatch, density):
100100 self .num_shapes = 0
101101 self .num_vertices = 0
102102 else :
103- self .num_shapes = ((self .num_rows / 2 + 1 ) * (self .num_rows + 1 ) +
104- (self .num_rows / 2 ) * (self .num_rows ))
103+ self .num_shapes = ((self .num_rows // 2 + 1 ) * (self .num_rows + 1 ) +
104+ (self .num_rows // 2 ) * (self .num_rows ))
105105 self .num_vertices = (self .num_shapes *
106106 len (self .shape_vertices ) *
107107 (self .filled and 1 or 2 ))
0 commit comments