… | |
… | |
732 | my $col_expand = (sum @col_expand) || 1; |
732 | my $col_expand = (sum @col_expand) || 1; |
733 | |
733 | |
734 | # linearly scale sizes |
734 | # linearly scale sizes |
735 | $ws->[$_] += $col_expand[$_] / $col_expand * ($w - $req_w) for 0 .. $#$ws; |
735 | $ws->[$_] += $col_expand[$_] / $col_expand * ($w - $req_w) for 0 .. $#$ws; |
736 | $hs->[$_] *= 1 * $h / $req_h for 0 .. $#$hs; |
736 | $hs->[$_] *= 1 * $h / $req_h for 0 .. $#$hs; |
|
|
737 | |
|
|
738 | $_ = int $_ for @$ws; #TODO: avoid rounding problems |
|
|
739 | $_ = int $_ for @$hs; #TODO: avoid rounding problems |
737 | |
740 | |
738 | my $y; |
741 | my $y; |
739 | |
742 | |
740 | for my $r (0 .. $#{$self->{children}}) { |
743 | for my $r (0 .. $#{$self->{children}}) { |
741 | my $row = $self->{children}[$r] |
744 | my $row = $self->{children}[$r] |
… | |
… | |
1592 | glEnable GL_TEXTURE_2D; |
1595 | glEnable GL_TEXTURE_2D; |
1593 | glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE; |
1596 | glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE; |
1594 | $self->{texture}->draw_quad (0, 0, $self->{w}, $self->{h}); |
1597 | $self->{texture}->draw_quad (0, 0, $self->{w}, $self->{h}); |
1595 | glDisable GL_TEXTURE_2D; |
1598 | glDisable GL_TEXTURE_2D; |
1596 | } |
1599 | } |
|
|
1600 | |
|
|
1601 | $self->{children}[1]->draw; |
1597 | |
1602 | |
1598 | } |
1603 | } |
1599 | |
1604 | |
1600 | ############################################################################# |
1605 | ############################################################################# |
1601 | |
1606 | |