[英]magic numbers in qwt
Qwt seems to be using a lot of magic numbers. Qwt似乎使用了很多魔术数字。 Could anyone please explain what 90 and 16 from the following code
任何人都可以从以下代码中解释90和16
void QwtRoundScaleDraw::drawBackbone( QPainter *painter ) const
{
const double a1 = qMin( scaleMap().p1(), scaleMap().p2() ) - 90 * 16;
const double a2 = qMax( scaleMap().p1(), scaleMap().p2() ) - 90 * 16;
const double radius = d_data->radius;
const double x = d_data->center.x() - radius;
const double y = d_data->center.y() - radius;
painter->drawArc( x, y, 2 * radius, 2 * radius,
-a2, a2 - a1 + 1 ); // counterclockwise
}
Steps to figure it out: 解决问题的步骤:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.