| 1 | #_{ Encoding and name | ||||||||||
| 2 | =encoding utf8 | ||||||||||
| 3 | =head1 NAME | ||||||||||
| 4 | Grid::Layout::Cell | ||||||||||
| 5 | =cut | ||||||||||
| 6 | #_} | ||||||||||
| 7 | package Grid::Layout::Cell; | ||||||||||
| 8 | #_{ use … | ||||||||||
| 9 | 5 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | 5 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | 5 | ▶ | use utf8; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 12 | |||||||||||
| 13 | 5 | ▶ | use Carp; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 14 | #_} | ||||||||||
| 15 | 5 | our $VERSION = 0.01; | |||||||||
| 16 | #_{ Synopsis | ||||||||||
| 17 | |||||||||||
| 18 | =head1 SYNOPSIS | ||||||||||
| 19 | =cut | ||||||||||
| 20 | #_} | ||||||||||
| 21 | #_{ Description | ||||||||||
| 22 | |||||||||||
| 23 | =head1 DESCRIPTION | ||||||||||
| 24 | |||||||||||
| 25 | A C<< Grid::Layout::Cell >> is the intersection of two orthogonal | ||||||||||
| 26 | L<< Grid::Layout::Track >>s. | ||||||||||
| 27 | |||||||||||
| 28 | It is the smallest unit with size in a grid. | ||||||||||
| 29 | |||||||||||
| 30 | Although the I<logical size> for all cells is equal, the I<physical size> of rendered cell can vary. | ||||||||||
| 31 | |||||||||||
| 32 | =cut | ||||||||||
| 33 | #_} | ||||||||||
| 34 | #_{ Methods | ||||||||||
| 35 | #_{ POD | ||||||||||
| 36 | =head1 METHODS | ||||||||||
| 37 | =cut | ||||||||||
| 38 | #_} | ||||||||||
| 39 | 136 | ▶ | sub new { #_{ | ||||||||
|
Subroutine
new: called CC=4 SCAR=14.0
Pod
undocumented
| |||||||||||
| 40 | #_{ POD | ||||||||||
| 41 | =head2 new | ||||||||||
| 42 | |||||||||||
| 43 | =cut | ||||||||||
| 44 | #_} | ||||||||||
| 45 | |||||||||||
| 46 | |||||||||||
| 47 | 136 | my $class = shift; | |||||||||
| 48 | |||||||||||
| 49 | 136 | my $grid_layout = shift; | |||||||||
| 50 | 136 | my $x = shift; | |||||||||
| 51 | 136 | my $y = shift; | |||||||||
| 52 | |||||||||||
| 53 | 136 | ▶ | croak 'Grid::Layout expected' unless $grid_layout->isa('Grid::Layout' ); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 54 | 136 | ▶ | croak 'Number expected' unless $x =~ /^\d+/; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 55 | 136 | ▶ | croak 'Number expected' unless $y =~ /^\d+/; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 56 | |||||||||||
| 57 | 136 | my $self = {}; | |||||||||
| 58 | |||||||||||
| 59 | 136 | $self->{grid_layout} = $grid_layout; | |||||||||
| 60 | 136 | $self->{x } = $x; | |||||||||
| 61 | 136 | $self->{y } = $y; | |||||||||
| 62 | |||||||||||
| 63 | 136 | bless $self, $class; | |||||||||
| 64 | 136 | return $self; | |||||||||
| 65 | |||||||||||
| 66 | } #_} | ||||||||||
| 67 | #_{ x/y | ||||||||||
| 68 | 143 | ▶ | sub x { #_{ | ||||||||
|
Subroutine
x: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 69 | 143 | my $self = shift; | |||||||||
| 70 | 143 | return $self->{x}; | |||||||||
| 71 | } #_} | ||||||||||
| 72 | 126 | ▶ | sub y { #_{ | ||||||||
|
Subroutine
y: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 73 | 126 | my $self = shift; | |||||||||
| 74 | 126 | return $self->{y}; | |||||||||
| 75 | } #_} | ||||||||||
| 76 | #_} | ||||||||||
| 77 | #_} | ||||||||||
| 78 | #_{ POD: Copyright | ||||||||||
| 79 | |||||||||||
| 80 | =head1 Copyright | ||||||||||
| 81 | |||||||||||
| 82 | Copyright © 2017 René Nyffenegger, Switzerland. All rights reserved. | ||||||||||
| 83 | This program is free software; you can redistribute it and/or modify it | ||||||||||
| 84 | under the terms of the the Artistic License (2.0). You may obtain a | ||||||||||
| 85 | copy of the full license at: L<http://www.perlfoundation.org/artistic_license_2_0> | ||||||||||
| 86 | |||||||||||
| 87 | =cut | ||||||||||
| 88 | |||||||||||
| 89 | #_} | ||||||||||
| 90 | |||||||||||
| 91 | 5 | 'tq84'; | |||||||||