MCPcopy Create free account
hub / github.com/LUX-Core/lux / drawBracket

Method drawBracket

src/qt/qcustomplot.cpp:16491–16524  ·  view source on GitHub ↗

! Draws the bracket shape with \a painter. The parameter \a direction is either -1 or 1 and indicates whether the bracket shall point to the left or the right (i.e. is a closing or opening bracket, respectively). The passed \a painter already contains all transformations that are necessary to position and rotate the bracket appropriately. Painting operations can be performed as if dra

Source from the content-addressed store, hash-verified

16489 reimplement.
16490*/
16491void QCPSelectionDecoratorBracket::drawBracket(QCPPainter *painter, int direction) const
16492{
16493 switch (mBracketStyle)
16494 {
16495 case bsSquareBracket:
16496 {
16497 painter->drawLine(QLineF(mBracketWidth*direction, -mBracketHeight*0.5, 0, -mBracketHeight*0.5));
16498 painter->drawLine(QLineF(mBracketWidth*direction, mBracketHeight*0.5, 0, mBracketHeight*0.5));
16499 painter->drawLine(QLineF(0, -mBracketHeight*0.5, 0, mBracketHeight*0.5));
16500 break;
16501 }
16502 case bsHalfEllipse:
16503 {
16504 painter->drawArc(-mBracketWidth*0.5, -mBracketHeight*0.5, mBracketWidth, mBracketHeight, -90*16, -180*16*direction);
16505 break;
16506 }
16507 case bsEllipse:
16508 {
16509 painter->drawEllipse(-mBracketWidth*0.5, -mBracketHeight*0.5, mBracketWidth, mBracketHeight);
16510 break;
16511 }
16512 case bsPlus:
16513 {
16514 painter->drawLine(QLineF(0, -mBracketHeight*0.5, 0, mBracketHeight*0.5));
16515 painter->drawLine(QLineF(-mBracketWidth*0.5, 0, mBracketWidth*0.5, 0));
16516 break;
16517 }
16518 default:
16519 {
16520 qDebug() << Q_FUNC_INFO << "unknown/custom bracket style can't be handeld by default implementation:" << static_cast<int>(mBracketStyle);
16521 break;
16522 }
16523 }
16524}
16525
16526/*!
16527 Draws the bracket decoration on the data points at the begin and end of each selected data

Callers

nothing calls this directly

Calls 1

drawLineMethod · 0.80

Tested by

no test coverage detected