rep: pull out renderDuration()
parent
75c6972f3f
commit
e83b582928
|
|
@ -31,23 +31,7 @@ let state: State | undefined;
|
|||
let drawInterval: IntervalId | undefined;
|
||||
let lastRepIndex: number | null = null;
|
||||
|
||||
const layout = new Layout({
|
||||
type: "v",
|
||||
c: [
|
||||
{
|
||||
id: "repIdx",
|
||||
type: "txt",
|
||||
label: "Begin",
|
||||
font: `Vector:${fontSzRepDesc}`,
|
||||
},
|
||||
{
|
||||
id: "duration",
|
||||
lazyBuster: 1,
|
||||
type: "custom",
|
||||
font: `Vector:${fontSzMain}` as FontNameWithScaleFactor,
|
||||
fillx: 1,
|
||||
filly: 1,
|
||||
render: (l: Layout.RenderedHierarchy) => {
|
||||
const renderDuration = (l: Layout.RenderedHierarchy) => {
|
||||
let lbl;
|
||||
|
||||
g.clearRect(l.x, l.y, l.x+l.w, l.y+l.h);
|
||||
|
|
@ -84,7 +68,25 @@ const layout = new Layout({
|
|||
l.x+(l.w>>1),
|
||||
l.y+(l.h>>1)
|
||||
);
|
||||
};
|
||||
|
||||
const layout = new Layout({
|
||||
type: "v",
|
||||
c: [
|
||||
{
|
||||
id: "repIdx",
|
||||
type: "txt",
|
||||
label: "Begin",
|
||||
font: `Vector:${fontSzRepDesc}`,
|
||||
},
|
||||
{
|
||||
id: "duration",
|
||||
lazyBuster: 1,
|
||||
type: "custom",
|
||||
font: `Vector:${fontSzMain}` as FontNameWithScaleFactor,
|
||||
fillx: 1,
|
||||
filly: 1,
|
||||
render: renderDuration,
|
||||
},
|
||||
{
|
||||
type: "txt",
|
||||
|
|
|
|||
Loading…
Reference in New Issue