Skip to content

Commit 9fbf414

Browse files
committed
label fixed size
1 parent 4434e55 commit 9fbf414

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

  • lib/PDL/Graphics/TriD

lib/PDL/Graphics/TriD/GL.pm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ fs_out_flat => " $FRAG_OUT = in_diffuse;\n",
152152
vs_in => " vec3 the_position = position;\n",
153153
vs_in_offset_decl => "$VS_IN vec3 offset;\n",
154154
vs_do_offset => " the_position += offset;\n",
155-
vs_do_toffset => " gl_Position += vec4(toffset, 0, 0);\n",
155+
vs_do_toffset => " gl_Position /= gl_Position.w;\n gl_Position.xy += toffset;\n",
156156
vs_out => " gl_Position = uMVP * vec4(the_position, 1);\n",
157157
vs_out_light => <<'EOF',
158158
vNormal = normalize(uNormalMatrix * normal);
@@ -502,8 +502,8 @@ sub togl_setup {
502502
$points //= $this->{Points}; # as Labels is used in Graph
503503
my $numchars = $FONT{numchars};
504504
my $vert_template = PDL->new(PDL::float, [0,1], [0,0], [1,1], [1,0]);
505-
my $dwidth = $PDL::Graphics::TriD::Window::DEFAULT_WIDTH / 4;
506-
my $dheight = $PDL::Graphics::TriD::Window::DEFAULT_HEIGHT / 4;
505+
my $dwidth = $PDL::Graphics::TriD::Window::DEFAULT_WIDTH / 2.5;
506+
my $dheight = $PDL::Graphics::TriD::Window::DEFAULT_HEIGHT / 2.5;
507507
$vert_template *= PDL::float(1 / $dwidth, $FONT{heightpix} / $dheight);
508508
my @codes = map [map ord, split //], @{ $this->{Strings} };
509509
my ($v2, @v1, @v3) = PDL->null;

0 commit comments

Comments
 (0)