// public BufferParameters::BufferParameters(int quadrantSegments, EndCapStyle endCapStyle, JoinStyle joinStyle, double mitreLimit) : quadrantSegments(DEFAULT_QUADRANT_SEGMENTS), endCapStyle(CAP_ROUND), joinStyle(JOIN_ROUND), mitreLimit(DEFAULT_MITRE_LIMIT), _isSingleSided(false) { setQuadrantSegments(quadrantSegments); setEndCapStyle(endCapStyle); setJoinStyle(joinStyle); setMitreLimit(mitreLimit); }
void UploadAnimation::paintFrame(Painter &p, style::color color, int x, int y, int outerWidth, int frameMs) { PainterHighQualityEnabler hq(p); auto pen = color->p; pen.setWidth(st::historySendActionUploadStrokeNumerator / st::historySendActionUploadDenominator); pen.setJoinStyle(Qt::RoundJoin); pen.setCapStyle(Qt::RoundCap); p.setPen(pen); p.setBrush(Qt::NoBrush); auto progress = frameMs / float64(st::historySendActionUploadDuration); auto position = QPointF(x + st::historySendActionUploadDelta * progress, y) + st::historySendActionUploadPosition; auto path = QPainterPath(); path.moveTo(0., -st::historySendActionUploadSizeNumerator / st::historySendActionUploadDenominator); path.lineTo(st::historySendActionUploadSizeNumerator / st::historySendActionUploadDenominator, 0.); path.lineTo(0., st::historySendActionUploadSizeNumerator / st::historySendActionUploadDenominator); p.translate(position); for (auto i = 0; i != kUploadArrowsCount; ++i) { p.setOpacity((i == 0) ? progress : (i == kUploadArrowsCount - 1) ? (1. - progress) : 1.); p.drawPath(path); position.setX(position.x() + st::historySendActionUploadDelta); p.translate(st::historySendActionUploadDelta, 0); } p.setOpacity(1.); p.translate(-position); }