Module:Ups and downs sharpness: Difference between revisions
Tristanbay (talk | contribs) added forced cell widths |
Tristanbay (talk | contribs) changed forced cell widths |
||
| Line 47: | Line 47: | ||
end | end | ||
tab = tab .. "\n|-\n! Sharp symbol\n" | tab = tab .. "\n|-\n! Sharp symbol\n" | ||
.. "| rowspan=\"2\" style=\"white-space:nowrap; width: | .. "| rowspan=\"2\" style=\"white-space:nowrap; width:3em\" |  [[File:Heji18.svg|15px]]\n" | ||
for i = 1, sharp * 2 do | for i = 1, sharp * 2 do | ||
local cs = math.ceil((i / sharp) - 0.5) -- sharpness of note | local cs = math.ceil((i / sharp) - 0.5) -- sharpness of note | ||
| Line 58: | Line 58: | ||
elseif cs == 1 then | elseif cs == 1 then | ||
marg = sharp_marg | marg = sharp_marg | ||
cell_width = | cell_width = 1.5 | ||
elseif cs == 2 then | elseif cs == 2 then | ||
marg = double_sharp_marg | marg = double_sharp_marg | ||
cell_width = | cell_width = 2.5 | ||
else | else | ||
marg = 0 -- Failsafe | marg = 0 -- Failsafe | ||
| Line 69: | Line 69: | ||
if (i - (sharp * math.floor(i / sharp))) % 5 == 4 then | if (i - (sharp * math.floor(i / sharp))) % 5 == 4 then | ||
s = s .. " [[File:Down arrow petaluma script.svg|10px]] [[File:Quip narrow.svg|9px]]" | s = s .. " [[File:Down arrow petaluma script.svg|10px]] [[File:Quip narrow.svg|9px]]" | ||
cell_width = cell_width + | cell_width = cell_width + 3 | ||
else | else | ||
for j = 1, (i - (sharp * math.floor(i / sharp))) % 5 do | for j = 1, (i - (sharp * math.floor(i / sharp))) % 5 do | ||
s = s .. " [[File:Up arrow petaluma script.svg|10px]]" | s = s .. " [[File:Up arrow petaluma script.svg|10px]]" | ||
cell_width = cell_width + | cell_width = cell_width + 1.5 | ||
end | end | ||
end | end | ||
for j = 1, math.floor((i - (sharp * math.floor(i / sharp))) / 5) do | for j = 1, math.floor((i - (sharp * math.floor(i / sharp))) / 5) do | ||
s = s .. " [[File:Quip narrow.svg|9px]]" | s = s .. " [[File:Quip narrow.svg|9px]]" | ||
cell_width = cell_width + | cell_width = cell_width + 1.5 | ||
end | end | ||
else | else | ||
if ((sharp * math.ceil(i / sharp)) - i) % 5 == 4 then | if ((sharp * math.ceil(i / sharp)) - i) % 5 == 4 then | ||
s = s .. " [[File:Up arrow petaluma script.svg|10px]] [[File:Quid narrow.svg|9px]]" | s = s .. " [[File:Up arrow petaluma script.svg|10px]] [[File:Quid narrow.svg|9px]]" | ||
cell_width = cell_width + | cell_width = cell_width + 3 | ||
else | else | ||
for j = 1, ((sharp * math.ceil(i / sharp)) - i) % 5 do | for j = 1, ((sharp * math.ceil(i / sharp)) - i) % 5 do | ||
s = s .. " [[File:Down arrow petaluma script.svg|10px]]" | s = s .. " [[File:Down arrow petaluma script.svg|10px]]" | ||
cell_width = cell_width + | cell_width = cell_width + 1.5 | ||
end | end | ||
end | end | ||
for j = 1, math.floor(((sharp * math.ceil(i / sharp)) - i) / 5) do | for j = 1, math.floor(((sharp * math.ceil(i / sharp)) - i) / 5) do | ||
s = s .. " [[File:Quid narrow.svg|9px]]" | s = s .. " [[File:Quid narrow.svg|9px]]" | ||
cell_width = cell_width + | cell_width = cell_width + 1.5 | ||
end | end | ||
end | end | ||
| Line 115: | Line 115: | ||
elseif cs == 1 then | elseif cs == 1 then | ||
marg = flat_marg | marg = flat_marg | ||
cell_width = | cell_width = 1.5 | ||
elseif cs == 2 then | elseif cs == 2 then | ||
marg = flat_marg | marg = flat_marg | ||
cell_width = | cell_width = 3 | ||
end | end | ||
| Line 124: | Line 124: | ||
if (i - (sharp * math.floor(i / sharp))) % 5 == 4 then | if (i - (sharp * math.floor(i / sharp))) % 5 == 4 then | ||
s = s .. " [[File:Up arrow petaluma script.svg|10px]] [[File:Quid narrow.svg|9px]]" | s = s .. " [[File:Up arrow petaluma script.svg|10px]] [[File:Quid narrow.svg|9px]]" | ||
cell_width = cell_width + | cell_width = cell_width + 3 | ||
else | else | ||
for j = 1, (i - (sharp * math.floor(i / sharp))) % 5 do | for j = 1, (i - (sharp * math.floor(i / sharp))) % 5 do | ||
s = s .. " [[File:Down arrow petaluma script.svg|10px]]" | s = s .. " [[File:Down arrow petaluma script.svg|10px]]" | ||
cell_width = cell_width + | cell_width = cell_width + 1.5 | ||
end | end | ||
end | end | ||
for j = 1, math.floor((i - (sharp * math.floor(i / sharp))) / 5) do | for j = 1, math.floor((i - (sharp * math.floor(i / sharp))) / 5) do | ||
s = s .. " [[File:Quid narrow.svg|9px]]" | s = s .. " [[File:Quid narrow.svg|9px]]" | ||
cell_width = cell_width + | cell_width = cell_width + 1.5 | ||
end | end | ||
else | else | ||
if ((sharp * math.ceil(i / sharp)) - i) % 5 == 4 then | if ((sharp * math.ceil(i / sharp)) - i) % 5 == 4 then | ||
s = s .. " [[File:Down arrow petaluma script.svg|10px]] [[File:Quip narrow.svg|9px]]" | s = s .. " [[File:Down arrow petaluma script.svg|10px]] [[File:Quip narrow.svg|9px]]" | ||
cell_width = cell_width + | cell_width = cell_width + 3 | ||
else | else | ||
for j = 1, ((sharp * math.ceil(i / sharp)) - i) % 5 do | for j = 1, ((sharp * math.ceil(i / sharp)) - i) % 5 do | ||
s = s .. " [[File:Up arrow petaluma script.svg|10px]]" | s = s .. " [[File:Up arrow petaluma script.svg|10px]]" | ||
cell_width = cell_width + | cell_width = cell_width + 1.5 | ||
end | end | ||
end | end | ||
for j = 1, math.floor(((sharp * math.ceil(i / sharp)) - i) / 5) do | for j = 1, math.floor(((sharp * math.ceil(i / sharp)) - i) / 5) do | ||
s = s .. " [[File:Quip narrow.svg|9px]]" | s = s .. " [[File:Quip narrow.svg|9px]]" | ||
cell_width = cell_width + | cell_width = cell_width + 1.5 | ||
end | end | ||
end | end | ||