|
|
@ -103,7 +103,7 @@ sub _do_pin($this, $pin, $dock = undef) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
sub render($this, $container, $width, $height, $laters = undef) |
|
|
|
sub render($this, $container, $width, $height, $layers) |
|
|
|
{ |
|
|
|
{ |
|
|
|
my $g = $container->g |
|
|
|
my $g = $container->g |
|
|
|
( |
|
|
|
( |
|
|
@ -112,8 +112,8 @@ sub render($this, $container, $width, $height, $laters = undef) |
|
|
|
my $hex = $g->polygon(points => hex_path($width, $height), |
|
|
|
my $hex = $g->polygon(points => hex_path($width, $height), |
|
|
|
id => "$this->{nw}_$this->{sw}_inner_hex", style => $this->style); |
|
|
|
id => "$this->{nw}_$this->{sw}_inner_hex", style => $this->style); |
|
|
|
# Have tile contents clip to the hexagon |
|
|
|
# Have tile contents clip to the hexagon |
|
|
|
my $clipPath = $g->clipPath(id => "$this->{nw}_$this->{sw}_clip"); |
|
|
|
my $clip_path = $g->clipPath(id => "$this->{nw}_$this->{sw}_clip"); |
|
|
|
$clipPath->use(href => "#$hex->{id}"); |
|
|
|
$clip_path->use(href => "#$hex->{id}"); |
|
|
|
|
|
|
|
|
|
|
|
if($this->{colour}) |
|
|
|
if($this->{colour}) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -128,7 +128,7 @@ sub render($this, $container, $width, $height, $laters = undef) |
|
|
|
# The actual image is defined at the HexGrid level, here we reference it |
|
|
|
# The actual image is defined at the HexGrid level, here we reference it |
|
|
|
my $use_element = $g->use(id => "$this->{nw}_$this->{sw}_${image}_use", |
|
|
|
my $use_element = $g->use(id => "$this->{nw}_$this->{sw}_${image}_use", |
|
|
|
href => "#${image}_symbol", width => $width, height => $height, |
|
|
|
href => "#${image}_symbol", width => $width, height => $height, |
|
|
|
"clip-path" => "url(#$clipPath->{id})"); |
|
|
|
"clip-path" => "url(#$clip_path->{id})"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -152,8 +152,8 @@ sub render($this, $container, $width, $height, $laters = undef) |
|
|
|
my $y = $height * $docks{$key}->{y}; |
|
|
|
my $y = $height * $docks{$key}->{y}; |
|
|
|
my $h = $height * $docks{$key}->{h}; |
|
|
|
my $h = $height * $docks{$key}->{h}; |
|
|
|
|
|
|
|
|
|
|
|
my $pin_element = $this->{pins}{$key}->render($g, $x, $y, $w, $h, $laters); |
|
|
|
push @{$layers->{pins}}, |
|
|
|
$pin_element->{"clip-path"} = "url(#$clipPath->{id})"; |
|
|
|
sub { $this->{pins}{$key}->render($g, $x, $y, $w, $h, $clip_path, $layers); }; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return $g; |
|
|
|
return $g; |
|
|
|