static paintGateTooltipHelper(painter, w, gate, time) {
        const [pad, dispSize] = [4, 65];
        let [maxX, maxY] = [0, pad];
        let pushRect = (rect, actualPad=pad) => {
            maxY = Math.max(maxY, rect.bottom() + actualPad);
            maxX = Math.max(maxX, rect.right() + actualPad);
        };

        pushRect(painter.printLine(gate.name, new Rect(pad, maxY, w, 18), 0, "blue", 24));
        if (gate.blurb !== '') {
            pushRect(painter.printParagraph(gate.blurb, new Rect(pad, maxY, w, 50), new Point(0, 0), 'black', 14));
        }

        let matrix = gate.knownMatrixAt(time);
        if (gate.definitelyHasNoEffect()) {
            return {maxX, maxY};
        }

        WidgetPainter._paintGateTooltip_matrix(painter, gate, matrix, pad, dispSize, w, pushRect, () => maxY);
        WidgetPainter._paintGateTooltip_rotation(painter, gate, matrix, pad, dispSize, w, pushRect, () => maxY);
        WidgetPainter._paintGateTooltip_circuit(
            painter, gate.knownCircuitNested, pad, dispSize, w, pushRect, () => maxY, time);

        return {maxX, maxY};
    }
@param {!Painter} painter
@param {!number} w
@param {!Gate} gate
@param {!number} time
@returns {!{maxX: !number, maxY: !number}}
@private