… | |
… | |
13 | my ($class, %arg) = @_; |
13 | my ($class, %arg) = @_; |
14 | |
14 | |
15 | my $items = delete $arg{items}; |
15 | my $items = delete $arg{items}; |
16 | |
16 | |
17 | my $self = $class->SUPER::new ( |
17 | my $self = $class->SUPER::new ( |
18 | items => [], |
18 | items => [], |
19 | @_, |
19 | @_, |
20 | ); |
20 | ); |
21 | |
21 | |
22 | $self->add (@$items) |
22 | $self->add (@$items) |
23 | if $items && @$items; |
23 | if $items && @$items; |
… | |
… | |
46 | sub size_request { |
46 | sub size_request { |
47 | my ($self) = @_; |
47 | my ($self) = @_; |
48 | |
48 | |
49 | my ($w, $h) = $self->SUPER::size_request; |
49 | my ($w, $h) = $self->SUPER::size_request; |
50 | |
50 | |
51 | ((max $w, $self->{item_max_w}), (max $h, $self->{item_max_h})) |
51 | ( |
|
|
52 | (max $w, $self->{item_max_w}), |
|
|
53 | (max $h, $self->{item_max_h}), |
|
|
54 | ) |
52 | } |
55 | } |
53 | |
56 | |
54 | my %GLTYPE = ( |
57 | my %GLTYPE = ( |
55 | lines => GL_LINES, |
58 | lines => GL_LINES, |
56 | line_strip => GL_LINE_STRIP, |
59 | line_strip => GL_LINE_STRIP, |