git.shiar.nl
/
sheet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
charset: common cell formatting for unicode planes
[sheet.git]
/
charset.plp
diff --git
a/charset.plp
b/charset.plp
index e55e771f2acd2a78196d0cb41db45db4b060a2c1..15183cfb479eae12889f06cfd41d5512b3be4c62 100644
(file)
--- a/
charset.plp
+++ b/
charset.plp
@@
-107,15
+107,16
@@
sub range_cell {
my ($len, $class, $name, $title) = @{$def};
my $attr = '';
my ($len, $class, $name, $title) = @{$def};
my $attr = '';
+ $len /= $nibsize;
$name //= $len <= 2 ? 'res' : 'reserved';
$name //= $len <= 2 ? 'res' : 'reserved';
- if (my $part = $offset % 16) {
+ if (my $part = $offset
/$nibsize
% 16) {
# continued row
my $cols = 16 - $part; # remaining
$cols = $len if $len < $cols; #TODO: optimise
if ($len -= $cols) {
# continued on new row
# continued row
my $cols = 16 - $part; # remaining
$cols = $len if $len < $cols; #TODO: optimise
if ($len -= $cols) {
# continued on new row
- $table->{$offset + $
cols} = [$len
, "$class joinu", $name, $title];
+ $table->{$offset + $
nibsize*$cols} = [$len*$nibsize
, "$class joinu", $name, $title];
$name = '';
$class .= ' joind';
}
$name = '';
$class .= ' joind';
}
@@
-125,7
+126,7
@@
sub range_cell {
# multiple full rows
if ($len -= $rows << 4) {
# partial row remains
# multiple full rows
if ($len -= $rows << 4) {
# partial row remains
- $table->{$offset + $
rows * 16} = [$len
, "$class joinu", '', $title];
+ $table->{$offset + $
nibsize*$rows * 16} = [$len*$nibsize
, "$class joinu", '', $title];
$class .= ' joind';
}
$attr .= sprintf ' rowspan=%d', $rows;
$class .= ' joind';
}
$attr .= sprintf ' rowspan=%d', $rows;
@@
-149,7
+150,7
@@
for my $row (@request) {
}
print '<tbody>';
for my $msb (0 .. (length($row->{table}) || 256) - 1 >> 4) {
}
print '<tbody>';
for my $msb (0 .. (length($row->{table}) || 256) - 1 >> 4) {
- printf '<tr><th>%X',
$msb + ($row->{offset} >> 4)
;
+ printf '<tr><th>%X',
($msb + ($row->{offset} >> 4)) * $nibsize
;
for my $lsb (0 .. $#nibble) {
my $val = ( ($msb<<4) + $lsb ) * $nibsize;
if ($row->{cell}) {
for my $lsb (0 .. $#nibble) {
my $val = ( ($msb<<4) + $lsb ) * $nibsize;
if ($row->{cell}) {