diff --git a/HexGrid/Path.pm b/HexGrid/Path.pm index 5203dd5..3c3e9c1 100644 --- a/HexGrid/Path.pm +++ b/HexGrid/Path.pm @@ -40,10 +40,6 @@ sub get_edge_direction($tile1, $tile2) return undef; } -sub curve_to($qx, $qy, $x, $y) -{ - return "Q $qx,$qy $x,$y"; -} # Instance @@ -188,7 +184,7 @@ sub render($this, $grid, $svg) ($x0, $y0) = $grid->coords_of_edge($previous_tile->nw, $previous_tile->sw, $this->starts_from); $path_spec .= "M $x0,$y0 "; my ($cx, $cy) = $grid->coords_of_centre($previous_tile->nw, $previous_tile->sw); - $path_spec .= curve_to($cx, $cy, $x, $y); + $path_spec .= "Q $cx,$cy $x,$y"; } else { @@ -207,7 +203,7 @@ sub render($this, $grid, $svg) my ($qx,$qy) = $grid->coords_of_centre($current_tile->nw, $current_tile->sw); ($x,$y) = $grid->coords_of_edge($current_tile->nw, $current_tile->sw, $next_edge); - $path_spec .= " " . curve_to($qx,$qy, $x,$y); + $path_spec .= " Q $qx,$qy $x,$y"; $previous_tile = $current_tile; $current_tile = $next_tile; @@ -218,7 +214,7 @@ sub render($this, $grid, $svg) { ($x, $y) = $grid->coords_of_centre($current_tile->nw, $current_tile->sw); my ($xe, $ye) = $grid->coords_of_edge($current_tile->nw, $current_tile->sw, $this->ends_to); - $path_spec .= curve_to($x, $y, $xe, $ye); + $path_spec .= "Q $x,$y $xe,$ye"; } else {