本文整理汇总了C++中FPoint::setY方法的典型用法代码示例。如果您正苦于以下问题:C++ FPoint::setY方法的具体用法?C++ FPoint::setY怎么用?C++ FPoint::setY使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FPoint
的用法示例。
在下文中一共展示了FPoint::setY方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: transformPoint
void ScPainterEx_GDI::transformPoint( const FPoint& in, FPoint& out )
{
double x, y;
x = in.x() * m_matrix.m11() + in.y() * m_matrix.m21() + m_matrix.dx();
y = in.x() * m_matrix.m12() + in.y() * m_matrix.m22() + m_matrix.dy();
out.setX( x );
out.setY( y );
}
示例2: doOneClick
bool CreateMode::doOneClick(FPoint& startPoint, FPoint& endPoint)
{
bool doCreate = false;
double xSize, ySize;
int originPoint = 0;
if (QApplication::keyboardModifiers() & Qt::ControlModifier)
return true;
PrefsContext* sizes = PrefsManager::instance()->prefsFile->getContext("ObjectSize");
bool doRemember = sizes->getBool("Remember", true);
int lmode = (createObjectMode == modeDrawLine) ? 1 : 0;
if (lmode == 0)
{
xSize = sizes->getDouble("defWidth", 100.0);
ySize = sizes->getDouble("defHeight", 100.0);
originPoint = sizes->getInt("Origin", 0);
}
else
{
xSize = sizes->getDouble("defLength", 100.0);
ySize = sizes->getDouble("defAngle", 0.0);
originPoint = sizes->getInt("OriginL", 0);
}
//#12577 Remove one click dialog
//#12577 OneClick *dia = new OneClick(m_view, ScribusView::tr("Enter Object Size"), m_doc->unitIndex(), xSize, ySize, doRemember, originPoint, lmode);
//#12577 if (dia->exec())
{
//#12577 doRemember = dia->checkRemember->isChecked();
if (lmode == 0)
{
//#12577 xSize = dia->spinWidth->value() / unitGetRatioFromIndex(m_doc->unitIndex());
//#12577 ySize = dia->spinHeight->value() / unitGetRatioFromIndex(m_doc->unitIndex());
//#12577 originPoint = dia->RotationGroup->checkedId();
if (doRemember)
{
sizes->set("defWidth", xSize);
sizes->set("defHeight", ySize);
sizes->set("Origin", originPoint);
}
endPoint.setXY(startPoint.x() + xSize, startPoint.y() + ySize);
switch (originPoint)
{
case 0:
break;
case 1:
startPoint.setX(startPoint.x() - xSize);
endPoint.setX(endPoint.x() - xSize);
break;
case 2:
startPoint.setXY(startPoint.x() - xSize / 2.0, startPoint.y() - ySize / 2.0);
endPoint.setXY(endPoint.x() - xSize / 2.0, endPoint.y() - ySize / 2.0);
break;
case 3:
startPoint.setY(startPoint.y() - ySize);
endPoint.setY(endPoint.y() - ySize);
break;
case 4:
startPoint.setXY(startPoint.x() - xSize, startPoint.y() - ySize);
endPoint.setXY(endPoint.x() - xSize, endPoint.y() - ySize);
break;
}
}
else
{
FPoint oldStart = startPoint;
//#12577 xSize = dia->spinWidth->value() / unitGetRatioFromIndex(m_doc->unitIndex());
//#12577 ySize = dia->spinHeight->value();
//#12577 originPoint = dia->RotationGroup->checkedId();
if (doRemember)
{
sizes->set("defLength", xSize);
sizes->set("defAngle", ySize);
sizes->set("OriginL", originPoint);
}
double angle = -ySize * M_PI / 180.0;
switch (originPoint)
{
case 0:
endPoint = FPoint(startPoint.x() + xSize * cos(angle), startPoint.y() + xSize * sin(angle));
break;
case 1:
startPoint = FPoint(oldStart.x() - xSize * cos(angle), oldStart.y() - xSize * sin(angle));
endPoint = oldStart;
break;
case 2:
startPoint = FPoint(oldStart.x() - xSize / 2.0 * cos(angle), oldStart.y() - xSize / 2.0 * sin(angle));
endPoint = FPoint(oldStart.x() + xSize / 2.0 * cos(angle), oldStart.y() + xSize / 2.0 * sin(angle));
break;
}
}
sizes->set("Remember", doRemember);
doCreate = true;
}
//delete dia;
return doCreate;
}