r20303 by jghali - #13282: "Edit Arc" dialog can only be used with pt as unit
scribus-commit
scribus-commit at lists.scribus.net
Sun Aug 9 13:39:36 UTC 2015
Author: jghali
Date: Sun Aug 9 13:39:36 2015
New Revision: 20303
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=20303
Log:
#13282: "Edit Arc" dialog can only be used with pt as unit
Modified:
trunk/Scribus/scribus/canvasmode_editarc.cpp
trunk/Scribus/scribus/ui/arcvectordialog.cpp
Modified: trunk/Scribus/scribus/canvasmode_editarc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20303&path=/trunk/Scribus/scribus/canvasmode_editarc.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_editarc.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_editarc.cpp Sun Aug 9 13:39:36 2015
@@ -174,12 +174,14 @@
QLineF res = QLineF(centerPoint, startPoint);
QLineF swe = QLineF(centerPoint, endPoint);
VectorDialog->setValues(res.angle(), swe.angle(), item->arcHeight, item->arcWidth);
+ VectorDialog->unitChange(m_doc->unitIndex());
VectorDialog->show();
setModeCursor();
if (fromGesture)
{
m_view->update();
}
+ connect(m_view, SIGNAL(changeUN(int)), VectorDialog, SLOT(unitChange(int)), Qt::UniqueConnection);
connect(VectorDialog, SIGNAL(NewVectors(double, double, double, double)), this, SLOT(applyValues(double, double, double, double)));
connect(VectorDialog, SIGNAL(endEdit()), this, SLOT(endEditing()));
connect(VectorDialog, SIGNAL(paletteShown(bool)), this, SLOT(endEditing(bool)));
@@ -252,7 +254,7 @@
pp.arcTo(QRectF(0, 0, width, height), startAngle, nSweep);
pp.closeSubpath();
currItem->PoLine.fromQPainterPath(pp, true);
- if(UndoManager::undoEnabled())
+ if (UndoManager::undoEnabled())
{
ScItemState<QPair<FPointArray, FPointArray> > *ss = new ScItemState<QPair<FPointArray, FPointArray> >(Um::EditArc,"",Um::IPolygon);
ss->set("ARC","arc");
Modified: trunk/Scribus/scribus/ui/arcvectordialog.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20303&path=/trunk/Scribus/scribus/ui/arcvectordialog.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/arcvectordialog.cpp (original)
+++ trunk/Scribus/scribus/ui/arcvectordialog.cpp Sun Aug 9 13:39:36 2015
@@ -63,8 +63,8 @@
disconnect(arcWidth, SIGNAL(valueChanged(double)), this, SLOT(changeVectors()));
startAngle->setValue(start);
sweepAngle->setValue(sweep);
- arcHeight->setValue(height);
- arcWidth->setValue(width);
+ arcHeight->setValue(height * arcHeight->unitRatio());
+ arcWidth->setValue(width * arcWidth->unitRatio());
connect(startAngle, SIGNAL(valueChanged(double)), this, SLOT(changeVectors()));
connect(sweepAngle, SIGNAL(valueChanged(double)), this, SLOT(changeVectors()));
connect(arcHeight, SIGNAL(valueChanged(double)), this, SLOT(changeVectors()));
@@ -73,7 +73,9 @@
void ArcVectorDialog::changeVectors()
{
- emit NewVectors(startAngle->value(), sweepAngle->value(), arcHeight->value(), arcWidth->value());
+ double newWidth = arcWidth->value() / arcWidth->unitRatio();
+ double newHeight = arcHeight->value() / arcHeight->unitRatio();
+ emit NewVectors(startAngle->value(), sweepAngle->value(), newHeight, newWidth);
}
void ArcVectorDialog::unitChange(int unitIndex)
More information about the scribus-commit
mailing list