MCPcopy Index your code
hub / github.com/Audio4Linux/JDSP4Linux / drawTickLabel

Method drawTickLabel

3rdparty/qcustomplot/qcustomplot.cpp:5573–5592  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5571}
5572
5573void QCPLabelPainterPrivate::drawTickLabel(QCPPainter *painter, const QPointF &tickPos, const QString &text)
5574{
5575 double realRotation = mRotation;
5576
5577 AnchorSide realSide = mAnchorSide;
5578 // for circular axes, the anchor side is determined depending on the quadrant of tickPos with respect to mCircularReference
5579 if (mAnchorMode == amSkewedUpright)
5580 {
5581 realSide = skewedAnchorSide(tickPos, 0.2, 0.3);
5582 } else if (mAnchorMode == amSkewedRotated) // in this mode every label is individually rotated to match circle tangent
5583 {
5584 realSide = skewedAnchorSide(tickPos, 0, 0);
5585 realRotation += QCPVector2D(tickPos-mAnchorReference).angle()/M_PI*180.0;
5586 if (realRotation > 90) realRotation -= 180;
5587 else if (realRotation < -90) realRotation += 180;
5588 }
5589
5590 realSide = rotationCorrectedSide(realSide, realRotation); // rotation angles may change the true anchor side of the label
5591 drawLabelMaybeCached(painter, mFont, mColor, getAnchorPos(tickPos), realSide, realRotation, text);
5592}
5593
5594/*! \internal
5595

Callers 1

drawMethod · 0.80

Calls 4

fontMethod · 0.80
setFontMethod · 0.80
drawTextMethod · 0.80
isEmptyMethod · 0.45

Tested by

no test coverage detected