Skip to content

Commit 7be3dd5

Browse files
committed
use separate $FONT_ID not store in %FONT
1 parent 02a6dc0 commit 7be3dd5

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

  • lib/PDL/Graphics/TriD

lib/PDL/Graphics/TriD/GL.pm

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ use OpenGL::Modern qw(
365365
GL_RGBA32F GL_RGBA
366366
);
367367
use PDL::Graphics::OpenGLQ;
368-
my %FONT;
368+
my (%FONT, $FONT_ID);
369369
sub _font_setup {
370370
my ($fref) = @_;
371371
my ($texture, $rightbound, $orig) = gl_font_texture();
@@ -392,12 +392,12 @@ sub _font_setup {
392392
sub togl_setup {
393393
my ($this,$points) = @_;
394394
print "togl_setup $this\n" if $PDL::Graphics::TriD::verbose;
395-
if (keys %FONT and glIsTexture($FONT{font_id})) {
396-
$this->{Impl}{font_id} = $FONT{font_id};
395+
_font_setup(\%FONT) if !keys %FONT;
396+
if (defined $FONT_ID and glIsTexture($FONT_ID)) {
397+
$this->{Impl}{font_id} = $FONT_ID;
397398
} else {
398-
_font_setup(\%FONT);
399399
$this->load_texture(font_id => $FONT{texture}, GL_RGBA32F, ($FONT{texture}->dims)[1,2], GL_RGBA);
400-
$FONT{font_id} = $this->{Impl}{font_id};
400+
$FONT_ID = $this->{Impl}{font_id};
401401
}
402402
$points //= $this->{Points}; # as Labels is used in Graph
403403
my $numchars = $FONT{numchars};

0 commit comments

Comments
 (0)