static _paintGateTooltip_circuit(painter, nestedCircuit, pad, dispSize, w, pushRect, nextY, time) {
        if (nestedCircuit === undefined) {
            return;
        }

        let weight = nestedCircuit.gateWeight();

        pushRect(new Rect(0, nextY(), 1, 0), pad*2);
        pushRect(painter.printParagraph(
            `As circuit (gate weight = ${weight}):`,
            new Rect(pad, nextY(), w, 18),
            new Point(0, 0),
            'black',
            12), 0);

        let circuitRect = new Rect(pad, nextY(), w, dispSize);
        let {maxW, maxH} = drawCircuitTooltip(painter, nestedCircuit, circuitRect, true, time);
        pushRect(circuitRect.withW(maxW).withH(maxH));
    }
@param {!Painter} painter
@param {undefined|!CircuitDefinition} nestedCircuit
@param {!number} pad
@param {!number} dispSize
@param {!number} w
@param {!function(!Rect, pad:!number=):void} pushRect
@param {!function():!number} nextY
@param {!number} time
@private