MCPcopy Create free account
hub / github.com/XMuli/ChineseChess / getRealPoint

Method getRealPoint

ChessBoard.cpp:534–546  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

532}
533
534QPointF ChessBoard::getRealPoint(QPointF pt)
535{
536 QPointF origin;
537 qreal side = 0.0;
538 if (!boardTransform(origin, side) || side <= 0.0)
539 return QPointF(-1.0, -1.0);
540
541 const QPointF relative = pt - origin;
542 QPointF realPt;
543 realPt.setX(relative.x() * 960.0 / side);
544 realPt.setY(relative.y() * 960.0 / side);
545 return realPt;
546}
547
548bool ChessBoard:: isGeneral()
549{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected