r15345 by fschmid - Added the ability to scale Arrow Heads of Lines.
scribus-commit
scribus-commit at lists.scribus.net
Sat Jul 17 18:51:52 CEST 2010
Revision: 15345
Author: fschmid
Date: 2010-07-17T16:41:09.398955Z
Commit message: Added the ability to scale Arrow Heads of Lines.
Changeset:
M /trunk/Scribus/scribus/ui/propertiespalette.cpp
M /trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format_save.cpp
M /trunk/Scribus/scribus/pageitem.cpp
M /trunk/Scribus/scribus/scribusXml.cpp
M /trunk/Scribus/scribus/plugins/tools/pathstroker/pathstroker.cpp
M /trunk/Scribus/scribus/ui/propertiespalette.h
M /trunk/Scribus/scribus/scribusdoc.cpp
M /trunk/Scribus/scribus/pageitem.h
M /trunk/Scribus/scribus/pageitem_line.cpp
M /trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.cpp
M /trunk/Scribus/scribus/canvasmode_legacy.cpp
M /trunk/Scribus/scribus/scribusdoc.h
M /trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp
M /trunk/Scribus/scribus/pageitem_polyline.cpp
M /trunk/Scribus/scribus/scribusstructs.h
M /trunk/Scribus/scribus/plugins/svgexplugin/svgexplugin.cpp
M /trunk/Scribus/scribus/pdflib_core.cpp
M /trunk/Scribus/scribus/pslib.cpp
M /trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
M /trunk/Scribus/scribus/scribus.cpp
M /trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
M /trunk/Scribus/scribus/pageitem_desaxe.cpp
M /trunk/Scribus/scribus/stencilreader.cpp
M /trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
M /trunk/Scribus/scribus/canvasmode_copyproperties.cpp
Diffs:
Index: scribus/pdflib_core.cpp
===================================================================
--- scribus/pdflib_core.cpp (revision 15344)
+++ scribus/pdflib_core.cpp (revision 15345)
@@ -2175,12 +2175,14 @@
{
QTransform arrowTrans;
arrowTrans.scale(-1,1);
+ arrowTrans.scale(ite->startArrowScale() / 100.0, ite->startArrowScale() / 100.0);
PutPage(drawArrow(ite, arrowTrans, ite->startArrowIndex()));
}
if (ite->endArrowIndex() != 0)
{
QTransform arrowTrans;
arrowTrans.translate(ite->width(), 0);
+ arrowTrans.scale(ite->endArrowScale() / 100.0, ite->endArrowScale() / 100.0);
PutPage(drawArrow(ite, arrowTrans, ite->endArrowIndex()));
}
break;
@@ -2379,6 +2381,7 @@
QTransform arrowTrans;
arrowTrans.translate(Start.x(), Start.y());
arrowTrans.rotate(r);
+ arrowTrans.scale(ite->startArrowScale() / 100.0, ite->startArrowScale() / 100.0);
PutPage(drawArrow(ite, arrowTrans, ite->startArrowIndex()));
break;
}
@@ -2396,6 +2399,7 @@
QTransform arrowTrans;
arrowTrans.translate(End.x(), End.y());
arrowTrans.rotate(r);
+ arrowTrans.scale(ite->endArrowScale() / 100.0, ite->endArrowScale() / 100.0);
PutPage(drawArrow(ite, arrowTrans, ite->endArrowIndex()));
break;
}
@@ -3980,12 +3984,14 @@
{
QTransform arrowTrans;
arrowTrans.scale(-1,1);
+ arrowTrans.scale(ite->startArrowScale() / 100.0, ite->startArrowScale() / 100.0);
tmp += drawArrow(ite, arrowTrans, ite->startArrowIndex());
}
if (ite->endArrowIndex() != 0)
{
QTransform arrowTrans;
arrowTrans.translate(ite->width(), 0);
+ arrowTrans.scale(ite->endArrowScale() / 100.0, ite->endArrowScale() / 100.0);
tmp += drawArrow(ite, arrowTrans, ite->endArrowIndex());
}
break;
@@ -4185,6 +4191,7 @@
QTransform arrowTrans;
arrowTrans.translate(Start.x(), Start.y());
arrowTrans.rotate(r);
+ arrowTrans.scale(ite->startArrowScale() / 100.0, ite->startArrowScale() / 100.0);
tmp += drawArrow(ite, arrowTrans, ite->startArrowIndex());
break;
}
@@ -4202,6 +4209,7 @@
QTransform arrowTrans;
arrowTrans.translate(End.x(), End.y());
arrowTrans.rotate(r);
+ arrowTrans.scale(ite->endArrowScale() / 100.0, ite->endArrowScale() / 100.0);
tmp += drawArrow(ite, arrowTrans, ite->endArrowIndex());
break;
}
Index: scribus/pageitem_line.cpp
===================================================================
--- scribus/pageitem_line.cpp (revision 15344)
+++ scribus/pageitem_line.cpp (revision 15345)
@@ -128,12 +128,14 @@
QTransform arrowTrans;
arrowTrans.translate(0, 0);
arrowTrans.scale(-1,1);
+ arrowTrans.scale(m_startArrowScale / 100.0, m_startArrowScale / 100.0);
drawArrow(p, arrowTrans, m_startArrowIndex);
}
if (m_endArrowIndex != 0)
{
QTransform arrowTrans;
arrowTrans.translate(Width, 0);
+ arrowTrans.scale(m_endArrowScale / 100.0, m_endArrowScale / 100.0);
drawArrow(p, arrowTrans, m_endArrowIndex);
}
}
Index: scribus/canvasmode_legacy.cpp
===================================================================
--- scribus/canvasmode_legacy.cpp (revision 15344)
+++ scribus/canvasmode_legacy.cpp (revision 15345)
@@ -2184,6 +2184,8 @@
currItem->setCustomLineStyle(m_doc->ElemToLink->customLineStyle());
currItem->setEndArrowIndex(m_doc->ElemToLink->endArrowIndex());
currItem->setStartArrowIndex(m_doc->ElemToLink->startArrowIndex());
+ currItem->setEndArrowScale(m_doc->ElemToLink->endArrowScale());
+ currItem->setStartArrowScale(m_doc->ElemToLink->startArrowScale());
currItem->setFillColor(m_doc->ElemToLink->fillColor());
currItem->setFillShade(m_doc->ElemToLink->fillShade());
currItem->setFillTransparency(m_doc->ElemToLink->fillTransparency());
Index: scribus/canvasmode_copyproperties.cpp
===================================================================
--- scribus/canvasmode_copyproperties.cpp (revision 15344)
+++ scribus/canvasmode_copyproperties.cpp (revision 15345)
@@ -173,6 +173,8 @@
currItem->setCustomLineStyle(m_doc->ElemToLink->customLineStyle());
currItem->setEndArrowIndex(m_doc->ElemToLink->endArrowIndex());
currItem->setStartArrowIndex(m_doc->ElemToLink->startArrowIndex());
+ currItem->setEndArrowScale(m_doc->ElemToLink->endArrowScale());
+ currItem->setStartArrowScale(m_doc->ElemToLink->startArrowScale());
// Fill Properties
currItem->setFillColor(m_doc->ElemToLink->fillColor());
currItem->setFillShade(m_doc->ElemToLink->fillShade());
Index: scribus/scribusdoc.cpp
===================================================================
--- scribus/scribusdoc.cpp (revision 15344)
+++ scribus/scribusdoc.cpp (revision 15345)
@@ -4031,6 +4031,8 @@
currItem->setLineBlendmode(Buffer->TransBlendS);
currItem->setStartArrowIndex(Buffer->startArrowIndex);
currItem->setEndArrowIndex(Buffer->endArrowIndex);
+ currItem->setStartArrowScale(Buffer->startArrowScale);
+ currItem->setEndArrowScale(Buffer->endArrowScale);
currItem->setReversed(Buffer->Reverse);
currItem->NamedLStyle = Buffer->NamedLStyle;
currItem->Cols = Buffer->Cols;
@@ -10566,7 +10568,32 @@
changed();
}
+void ScribusDoc::itemSelection_ApplyArrowScale(int startArrowSc, int endArrowSc, Selection* customSelection)
+{
+ Selection* itemSelection = (customSelection!=0) ? customSelection : m_Selection;
+ assert(itemSelection!=0);
+ uint selectedItemCount=itemSelection->count();
+ if (selectedItemCount == 0)
+ return;
+ for (uint a = 0; a < selectedItemCount; ++a)
+ {
+ PageItem *currItem = itemSelection->itemAt(a);
+ if (!(currItem->asLine() || currItem->asPolyLine()))
+ continue;
+ if (startArrowSc != -1)
+ {
+ currItem->setStartArrowScale(startArrowSc);
+ }
+ if (endArrowSc != -1)
+ {
+ currItem->setEndArrowScale(endArrowSc);
+ }
+ currItem->update();
+ }
+ changed();
+}
+
void ScribusDoc::createDefaultMasterPages()
{
int setcol = pageSets()[currentPageLayout].Columns;
@@ -12473,7 +12500,7 @@
item->setRedrawBounding();
}
- bool viewToRecalcPictureRes=(docPrefsData.itemToolPrefs.imageLowResType==oldPrefsData.itemToolPrefs.imageLowResType);
+// bool viewToRecalcPictureRes = (docPrefsData.itemToolPrefs.imageLowResType==oldPrefsData.itemToolPrefs.imageLowResType);
autoSaveTimer->stop();
if (docPrefsData.docSetupPrefs.AutoSave)
@@ -12557,7 +12584,7 @@
m_ScMW->mainWindowProgressBar->reset();
}
}
- PrefsManager* prefsManager=PrefsManager::instance();
+// PrefsManager* prefsManager=PrefsManager::instance();
QStringList uf(UsedFonts.keys());
QMap<QString,int>::Iterator it3;
Index: scribus/pageitem_polyline.cpp
===================================================================
--- scribus/pageitem_polyline.cpp (revision 15344)
+++ scribus/pageitem_polyline.cpp (revision 15345)
@@ -172,6 +172,7 @@
QTransform arrowTrans;
arrowTrans.translate(Start.x(), Start.y());
arrowTrans.rotate(r);
+ arrowTrans.scale(m_startArrowScale / 100.0, m_startArrowScale / 100.0);
drawArrow(p, arrowTrans, m_startArrowIndex);
break;
}
@@ -189,6 +190,7 @@
QTransform arrowTrans;
arrowTrans.translate(End.x(), End.y());
arrowTrans.rotate(r);
+ arrowTrans.scale(m_endArrowScale / 100.0, m_endArrowScale / 100.0);
drawArrow(p, arrowTrans, m_endArrowIndex);
break;
}
Index: scribus/stencilreader.cpp
===================================================================
--- scribus/stencilreader.cpp (revision 15344)
+++ scribus/stencilreader.cpp (revision 15345)
@@ -1400,6 +1400,8 @@
ob.setAttribute("LANGUAGE", prefsManager->appPrefs.hyphPrefs.Language);
ob.setAttribute("startArrowIndex", 0);
ob.setAttribute("endArrowIndex", 0);
+ ob.setAttribute("startArrowScale", 100);
+ ob.setAttribute("endArrowScale", 100);
ob.setAttribute("NUMDASH", 0);
ob.setAttribute("DASHS", "");
ob.setAttribute("DASHOFF", 0);
Index: scribus/scribusXml.cpp
===================================================================
--- scribus/scribusXml.cpp (revision 15344)
+++ scribus/scribusXml.cpp (revision 15345)
@@ -852,6 +852,8 @@
writer.writeAttribute("LANGUAGE", charStyle.language());
writer.writeAttribute("startArrowIndex", item->startArrowIndex());
writer.writeAttribute("endArrowIndex" , item->endArrowIndex());
+ writer.writeAttribute("startArrowScale", item->startArrowScale());
+ writer.writeAttribute("endArrowScale" , item->endArrowScale());
}
//CB: Private only now
@@ -1854,6 +1856,8 @@
OB.Ypos = attrAsDbl(attrs1, "YPOS") + doc->currentPage()->yOffset();
OB.startArrowIndex = arrowID[ attrAsInt(attrs1, "startArrowIndex", 0) ];
OB.endArrowIndex = arrowID[ attrAsInt(attrs1, "endArrowIndex", 0)];
+ OB.startArrowScale = attrAsInt(attrs1, "startArrowScale", 100);
+ OB.endArrowScale = attrAsInt(attrs1, "endArrowScale", 100);
OB.isBookmark = attrAsInt(attrs1, "BOOKMARK");
OB.NamedLStyle = attrs1.value("NAMEDLST").toString();
if (!doc->MLineStyles.contains(OB.NamedLStyle))
Index: scribus/pageitem.h
===================================================================
--- scribus/pageitem.h (revision 15344)
+++ scribus/pageitem.h (revision 15345)
@@ -940,6 +940,26 @@
*/
void setEndArrowIndex(int newIndex);
+ /** @brief Get start arrow scale
+ * @sa PageItem::endArrowIndex(), PageItem::setStartArrowIndex()
+ */
+ int startArrowScale() const { return m_startArrowScale; }
+ /**
+ * @brief Set start arrow scale
+ * @param newIndex scale for start arrow
+ */
+ void setStartArrowScale(int newScale);
+
+ /** @brief Get end arrow scale
+ * @sa PageItem::startArrowIndex(), PageItem::setEndArrowIndex()
+ */
+ int endArrowScale() const { return m_endArrowScale; }
+ /**
+ * @brief Set end arrow scale
+ * @param newIndex scale for end arrow
+ */
+ void setEndArrowScale(int newScale);
+
/** @brief Is the image flipped horizontally? */
bool imageFlippedH() const { return m_ImageIsFlippedH; }
/** @brief Horizontally flip / unflip the image */
@@ -1388,6 +1408,8 @@
int m_startArrowIndex;
int m_endArrowIndex;
+ int m_startArrowScale;
+ int m_endArrowScale;
protected:
/** Left, Top, Bottom, Right distances of text from the frame */
Index: scribus/scribusstructs.h
===================================================================
--- scribus/scribusstructs.h (revision 15344)
+++ scribus/scribusstructs.h (revision 15345)
@@ -236,6 +236,8 @@
int BottomLinkID;
int startArrowIndex;
int endArrowIndex;
+ int startArrowScale;
+ int endArrowScale;
ObjAttrVector pageItemAttributes;
};
Index: scribus/pageitem.cpp
===================================================================
--- scribus/pageitem.cpp (revision 15344)
+++ scribus/pageitem.cpp (revision 15345)
@@ -258,6 +258,8 @@
Reverse(other.Reverse),
m_startArrowIndex(other.m_startArrowIndex),
m_endArrowIndex(other.m_endArrowIndex),
+ m_startArrowScale(other.m_startArrowScale),
+ m_endArrowScale(other.m_endArrowScale),
Extra(other.Extra),
TExtra(other.TExtra),
BExtra(other.BExtra),
@@ -808,6 +810,8 @@
OnMasterPage = m_Doc->currentPage() ? m_Doc->currentPage()->pageName() : QString();
m_startArrowIndex = m_Doc->itemToolPrefs().lineStartArrow;
m_endArrowIndex = m_Doc->itemToolPrefs().lineEndArrow;
+ m_startArrowScale = 100;
+ m_endArrowScale = 100;
effectsInUse.clear();
//Page Item Attributes
pageItemAttributes.clear();
@@ -3907,6 +3911,20 @@
m_endArrowIndex = newIndex;
}
+void PageItem::setStartArrowScale(int newScale)
+{
+ if (m_startArrowScale == newScale)
+ return; // nothing to do -> return
+ m_startArrowScale = newScale;
+}
+
+void PageItem::setEndArrowScale(int newScale)
+{
+ if (m_endArrowScale == newScale)
+ return; // nothing to do -> return
+ m_endArrowScale = newScale;
+}
+
void PageItem::setImageFlippedH(bool flipped)
{
if (flipped != m_ImageIsFlippedH)
@@ -5530,6 +5548,8 @@
}
Buffer->startArrowIndex = m_startArrowIndex;
Buffer->endArrowIndex = m_endArrowIndex;
+ Buffer->startArrowScale = m_startArrowScale;
+ Buffer->endArrowScale = m_endArrowScale;
}
@@ -5703,6 +5723,7 @@
if (itemType() == Line)
{
arrowTrans.translate(0, 0);
+ arrowTrans.scale(m_startArrowScale / 100.0, m_startArrowScale / 100.0);
if (NamedLStyle.isEmpty())
{
if (m_lineWidth != 0.0)
@@ -5727,6 +5748,7 @@
{
arrowTrans.translate(Start.x(), Start.y());
arrowTrans.rotate(atan2(Start.y()-Vector.y(),Start.x()-Vector.x())*(180.0/M_PI));
+ arrowTrans.scale(m_startArrowScale / 100.0, m_startArrowScale / 100.0);
if (NamedLStyle.isEmpty())
{
if (m_lineWidth != 0.0)
@@ -5756,6 +5778,7 @@
if (itemType() == Line)
{
arrowTrans.translate(Width, 0);
+ arrowTrans.scale(m_endArrowScale / 100.0, m_endArrowScale / 100.0);
if (NamedLStyle.isEmpty())
{
if (m_lineWidth != 0.0)
@@ -5779,6 +5802,7 @@
{
arrowTrans.translate(End.x(), End.y());
arrowTrans.rotate(atan2(End.y()-Vector.y(),End.x()-Vector.x())*(180.0/M_PI));
+ arrowTrans.scale(m_endArrowScale / 100.0, m_endArrowScale / 100.0);
if (NamedLStyle.isEmpty())
{
if (m_lineWidth != 0.0)
@@ -5868,6 +5892,7 @@
if (itemType() == Line)
{
arrowTrans.translate(0, 0);
+ arrowTrans.scale(m_startArrowScale / 100.0, m_startArrowScale / 100.0);
if (NamedLStyle.isEmpty())
{
if (m_lineWidth != 0.0)
@@ -5892,6 +5917,7 @@
{
arrowTrans.translate(Start.x(), Start.y());
arrowTrans.rotate(atan2(Start.y()-Vector.y(),Start.x()-Vector.x())*(180.0/M_PI));
+ arrowTrans.scale(m_startArrowScale / 100.0, m_startArrowScale / 100.0);
if (NamedLStyle.isEmpty())
{
if (m_lineWidth != 0.0)
@@ -5921,6 +5947,7 @@
if (itemType() == Line)
{
arrowTrans.translate(Width, 0);
+ arrowTrans.scale(m_endArrowScale / 100.0, m_endArrowScale / 100.0);
if (NamedLStyle.isEmpty())
{
if (m_lineWidth != 0.0)
@@ -5944,6 +5971,7 @@
{
arrowTrans.translate(End.x(), End.y());
arrowTrans.rotate(atan2(End.y()-Vector.y(),End.x()-Vector.x())*(180.0/M_PI));
+ arrowTrans.scale(m_endArrowScale / 100.0, m_endArrowScale / 100.0);
if (NamedLStyle.isEmpty())
{
if (m_lineWidth != 0.0)
Index: scribus/scribusdoc.h
===================================================================
--- scribus/scribusdoc.h (revision 15344)
+++ scribus/scribusdoc.h (revision 15345)
@@ -1276,6 +1276,7 @@
void itemSelection_AdjustImagetoFrameSize(Selection* customSelection=0);
//! @brief startArrowID or endArrowID of -1 mean not applying a selection at this point.
void itemSelection_ApplyArrowHead(int startArrowID=-1, int endArrowID=-1, Selection* customSelection=0);
+ void itemSelection_ApplyArrowScale(int startArrowSc, int endArrowSc, Selection* customSelection);
void itemSelection_SetItemPen(QString farbe);
void itemSelection_SetItemPenShade(int sha);
Index: scribus/ui/propertiespalette.cpp
===================================================================
--- scribus/ui/propertiespalette.cpp (revision 15344)
+++ scribus/ui/propertiespalette.cpp (revision 15345)
@@ -1045,21 +1045,44 @@
endArrowText = new QLabel( "End Arrow:", page_5 );
endArrowText->setBuddy(endArrow);
Layout12_2->addWidget( endArrowText, 3, 1 );
+
+ Layout12_2a = new QHBoxLayout;
+ Layout12_2a->setSpacing( 3 );
+ Layout12_2a->setMargin( 0 );
+ startArrowSpinText = new QLabel( "Scaling:", page_5 );
+ Layout12_2a->addWidget(startArrowSpinText);
+ startArrowScaleSpin = new QSpinBox(page_5 );
+ startArrowScaleSpin->setMaximum( 300 );
+ startArrowScaleSpin->setMinimum( 1 );
+ Layout12_2a->addWidget(startArrowScaleSpin);
+ Layout12_2->addLayout(Layout12_2a, 5, 0);
+
+ Layout12_2b = new QHBoxLayout;
+ Layout12_2b->setSpacing( 3 );
+ Layout12_2b->setMargin( 0 );
+ endArrowSpinText = new QLabel( "Scaling:", page_5 );
+ Layout12_2b->addWidget(endArrowSpinText);
+ endArrowScaleSpin = new QSpinBox(page_5 );
+ endArrowScaleSpin->setMaximum( 300 );
+ endArrowScaleSpin->setMinimum( 1 );
+ Layout12_2b->addWidget(endArrowScaleSpin);
+ Layout12_2->addLayout( Layout12_2b, 5, 1 );
+
LSize = new ScrSpinBox( page_5, 0 );
linewidthLabel = new QLabel( "Line &Width:", page_5 );
linewidthLabel->setBuddy(LSize);
- Layout12_2->addWidget( linewidthLabel, 5, 0 );
- Layout12_2->addWidget( LSize, 5, 1 );
+ Layout12_2->addWidget( linewidthLabel, 6, 0 );
+ Layout12_2->addWidget( LSize, 6, 1 );
LJoinStyle = new ScComboBox( page_5 );
edgesLabel = new QLabel( "Ed&ges:", page_5 );
edgesLabel->setBuddy(LJoinStyle);
- Layout12_2->addWidget( edgesLabel, 6, 0 );
- Layout12_2->addWidget( LJoinStyle, 6, 1 );
+ Layout12_2->addWidget( edgesLabel, 7, 0 );
+ Layout12_2->addWidget( LJoinStyle, 7, 1 );
LEndStyle = new ScComboBox( page_5 );
endingsLabel = new QLabel( "&Endings:", page_5 );
endingsLabel->setBuddy(LEndStyle);
- Layout12_2->addWidget( endingsLabel, 7, 0 );
- Layout12_2->addWidget( LEndStyle, 7, 1 );
+ Layout12_2->addWidget( endingsLabel, 8, 0 );
+ Layout12_2->addWidget( LEndStyle, 8, 1 );
pageLayout_5->addLayout( Layout12_2 );
TabStack3 = new QStackedWidget( page_5 );
@@ -1221,6 +1244,8 @@
connect( TpalGroup, SIGNAL(editGradient()), this, SLOT(toggleGradientEditMGroup()));
connect(startArrow, SIGNAL(activated(int)), this, SLOT(setStartArrow(int )));
connect(endArrow, SIGNAL(activated(int)), this, SLOT(setEndArrow(int )));
+ connect(startArrowScaleSpin, SIGNAL(valueChanged(int)), this, SLOT(setStartArrowScale(int )));
+ connect(endArrowScaleSpin, SIGNAL(valueChanged(int)), this, SLOT(setEndArrowScale(int )));
connect(lineSpacingModeCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(setLineSpacingMode(int)));
connect( EvenOdd, SIGNAL( clicked() ), this, SLOT(handleFillRule() ) );
connect( NonZero, SIGNAL( clicked() ), this, SLOT( handleFillRule() ) );
@@ -1560,6 +1585,8 @@
disconnect(NameEdit, SIGNAL(Leaved()), this, SLOT(NewName()));
disconnect(startArrow, SIGNAL(activated(int)), this, SLOT(setStartArrow(int )));
disconnect(endArrow, SIGNAL(activated(int)), this, SLOT(setEndArrow(int )));
+ disconnect(startArrowScaleSpin, SIGNAL(valueChanged(int)), this, SLOT(setStartArrowScale(int )));
+ disconnect(endArrowScaleSpin, SIGNAL(valueChanged(int)), this, SLOT(setEndArrowScale(int )));
disconnect(TabStack, SIGNAL(currentChanged(int)), this, SLOT(SelTab(int)));
disconnect(LineMode, SIGNAL(activated(int)), this, SLOT(NewLineMode()));
@@ -1584,11 +1611,17 @@
endArrow->setEnabled(true);
startArrow->setCurrentIndex(CurItem->startArrowIndex());
endArrow->setCurrentIndex(CurItem->endArrowIndex());
+ startArrowScaleSpin->setEnabled(true);
+ endArrowScaleSpin->setEnabled(true);
+ endArrowScaleSpin->setValue(CurItem->endArrowScale());
+ startArrowScaleSpin->setValue(CurItem->startArrowScale());
}
else
{
startArrow->setEnabled(false);
endArrow->setEnabled(false);
+ startArrowScaleSpin->setEnabled(false);
+ endArrowScaleSpin->setEnabled(false);
}
NameEdit->setText(CurItem->itemName());
RoundRect->setValue(CurItem->cornerRadius()*m_unitRatio);
@@ -1688,6 +1721,8 @@
connect(startArrow, SIGNAL(activated(int)), this, SLOT(setStartArrow(int )));
connect(endArrow, SIGNAL(activated(int)), this, SLOT(setEndArrow(int )));
connect(LineMode, SIGNAL(activated(int)), this, SLOT(NewLineMode()));
+ connect(startArrowScaleSpin, SIGNAL(valueChanged(int)), this, SLOT(setStartArrowScale(int )));
+ connect(endArrowScaleSpin, SIGNAL(valueChanged(int)), this, SLOT(setEndArrowScale(int )));
//CB replaces old emits from PageItem::emitAllToGUI()
disconnect(Xpos, SIGNAL(valueChanged(double)), this, SLOT(NewX()));
@@ -3521,6 +3556,21 @@
doc->itemSelection_ApplyArrowHead(-1, id);
}
+void PropertiesPalette::setStartArrowScale(int sc)
+{
+ if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
+ return;
+ doc->itemSelection_ApplyArrowScale(sc, -1, NULL);
+}
+
+void PropertiesPalette::setEndArrowScale(int sc)
+{
+ if (!m_ScMW || m_ScMW->scriptIsRunning())
+ return;
+ if ((HaveDoc) && (HaveItem))
+ doc->itemSelection_ApplyArrowScale(-1, sc, NULL);
+}
+
void PropertiesPalette::NewLineStyle()
{
if (!m_ScMW || m_ScMW->scriptIsRunning())
@@ -4942,6 +4992,8 @@
linetypeLabel->setText( tr("T&ype of Line:"));
startArrowText->setText( tr("Start Arrow:"));
endArrowText->setText( tr("End Arrow:"));
+ startArrowSpinText->setText( tr("Scaling:"));
+ endArrowSpinText->setText( tr("Scaling:"));
if (HaveDoc)
{
int arrowItem=startArrow->currentIndex();
@@ -4987,6 +5039,8 @@
normWordTrackingSpinBox->setSuffix(pctSuffix);
minGlyphExtSpinBox->setSuffix(pctSuffix);
maxGlyphExtSpinBox->setSuffix(pctSuffix);
+ startArrowScaleSpin->setSuffix(pctSuffix);
+ endArrowScaleSpin->setSuffix(pctSuffix);
QString ptSuffix = tr(" pt");
Dist->setSuffix(ptSuffix);
@@ -5081,6 +5135,8 @@
StyledLine->setToolTip( tr("Line style of current object"));
startArrow->setToolTip( tr("Arrow head style for start of line"));
endArrow->setToolTip( tr("Arrow head style for end of line"));
+ startArrowScaleSpin->setToolTip( tr("Arrow head scale for start of line"));
+ endArrowScaleSpin->setToolTip( tr("Arrow head scale for end of line"));
SCustom->setToolTip( tr("Choose the shape of frame..."));
EditShape->setToolTip( tr("Edit shape of the frame..."));
Index: scribus/ui/propertiespalette.h
===================================================================
--- scribus/ui/propertiespalette.h (revision 15344)
+++ scribus/ui/propertiespalette.h (revision 15345)
@@ -322,6 +322,8 @@
void HandleTLines();
void setStartArrow(int id);
void setEndArrow(int id);
+ void setStartArrowScale(int sc);
+ void setEndArrowScale(int sc);
void setGroupTransparency(double trans);
void setGroupBlending(int blend);
void setGroupGradMask(int typ);
@@ -395,6 +397,8 @@
QHBoxLayout* glyphExtensionHLayout;
QGridLayout* flopLayout;
QVBoxLayout* OptMarginsLayout;
+ QHBoxLayout* Layout12_2a;
+ QHBoxLayout* Layout12_2b;
NameWidget* NameEdit;
@@ -469,6 +473,8 @@
QLabel* glyphExtensionLabel;
QLabel* minGlyphExtensionLabel;
QLabel* maxGlyphExtensionLabel;
+ QLabel* startArrowSpinText;
+ QLabel* endArrowSpinText;
ScComboBox* colgapLabel;
StyleSelect* SeStyle;
@@ -589,6 +595,8 @@
QSpinBox* imagePageNumber;
QSpinBox* DCol;
QSpinBox* TransSpin;
+ QSpinBox* startArrowScaleSpin;
+ QSpinBox* endArrowScaleSpin;
QRadioButton* FreeScale;
QRadioButton* FrameScale;
Index: scribus/scribus.cpp
===================================================================
--- scribus/scribus.cpp (revision 15344)
+++ scribus/scribus.cpp (revision 15345)
@@ -8188,7 +8188,7 @@
{
QStringList args;
args << doc->pdfOptions().fileName;
- int ret=System(pdfViewer, args);
+ System(pdfViewer, args);
}
}
}
Index: scribus/plugins/tools/pathstroker/pathstroker.cpp
===================================================================
--- scribus/plugins/tools/pathstroker/pathstroker.cpp (revision 15344)
+++ scribus/plugins/tools/pathstroker/pathstroker.cpp (revision 15345)
@@ -156,6 +156,7 @@
FPointArray arrow = currDoc->arrowStyles().at(currItem->startArrowIndex()-1).points.copy();
arrowTrans.translate(Start.x(), Start.y());
arrowTrans.rotate(r);
+ arrowTrans.scale(currItem->startArrowScale() / 100.0, currItem->startArrowScale() / 100.0);
arrowTrans.scale(currItem->lineWidth(), currItem->lineWidth());
arrow.map(arrowTrans);
result.addPath(arrow.toQPainterPath(true));
@@ -176,6 +177,7 @@
FPointArray arrow = currDoc->arrowStyles().at(currItem->endArrowIndex()-1).points.copy();
arrowTrans.translate(End.x(), End.y());
arrowTrans.rotate(r);
+ arrowTrans.scale(currItem->endArrowScale() / 100.0, currItem->endArrowScale() / 100.0);
arrowTrans.scale(currItem->lineWidth(), currItem->lineWidth());
arrow.map(arrowTrans);
result.addPath(arrow.toQPainterPath(true));
@@ -274,6 +276,7 @@
FPointArray arrow = currDoc->arrowStyles().at(currItem->startArrowIndex()-1).points.copy();
arrowTrans.translate(Start.x(), Start.y());
arrowTrans.rotate(r);
+ arrowTrans.scale(currItem->startArrowScale() / 100.0, currItem->startArrowScale() / 100.0);
arrowTrans.scale(currItem->lineWidth(), currItem->lineWidth());
arrow.map(arrowTrans);
PageItem* newItem = new PageItem_Polygon(*currItem);
@@ -314,6 +317,7 @@
FPointArray arrow = currDoc->arrowStyles().at(currItem->endArrowIndex()-1).points.copy();
arrowTrans.translate(End.x(), End.y());
arrowTrans.rotate(r);
+ arrowTrans.scale(currItem->endArrowScale() / 100.0, currItem->endArrowScale() / 100.0);
arrowTrans.scale(currItem->lineWidth(), currItem->lineWidth());
arrow.map(arrowTrans);
PageItem* newItem = new PageItem_Polygon(*currItem);
Index: scribus/plugins/fileloader/scribus12format/scribus12format.cpp
===================================================================
--- scribus/plugins/fileloader/scribus12format/scribus12format.cpp (revision 15344)
+++ scribus/plugins/fileloader/scribus12format/scribus12format.cpp (revision 15345)
@@ -504,6 +504,8 @@
OB.textAlignment = obj.attribute("ALIGN", "0").toInt();
OB.startArrowIndex = 0;
OB.endArrowIndex = 0;
+ OB.startArrowScale = 100;
+ OB.endArrowScale = 100;
tmpf = obj.attribute("IFONT", m_Doc->itemToolPrefs().textFont);
m_AvailableFonts->findFont(tmpf, m_Doc);
OB.IFont = tmpf;
@@ -1376,6 +1378,8 @@
OB.NamedLStyle = "";
OB.startArrowIndex = 0;
OB.endArrowIndex = 0;
+ OB.startArrowScale = 100;
+ OB.endArrowScale = 100;
OB.isBookmark=obj.attribute("BOOKMARK").toInt();
if ((OB.isBookmark) && (m_Doc->BookMarks.count() == 0))
m_Doc->OldBM = true;
Index: scribus/plugins/fileloader/scribus13format/scribus13format.cpp
===================================================================
--- scribus/plugins/fileloader/scribus13format/scribus13format.cpp (revision 15344)
+++ scribus/plugins/fileloader/scribus13format/scribus13format.cpp (revision 15345)
@@ -2237,6 +2237,8 @@
endArrowIndex = 0;
}
currItem->setEndArrowIndex(endArrowIndex);
+ currItem->setStartArrowScale(obj->attribute("startArrowScale", "100").toInt());
+ currItem->setEndArrowScale(obj->attribute("endArrowScale", "100").toInt());
currItem->NamedLStyle = obj->attribute("NAMEDLST", "");
currItem->isBookmark = obj->attribute("BOOKMARK").toInt();
if ((currItem->isBookmark) && (doc->BookMarks.count() == 0))
@@ -3858,4 +3860,6 @@
ob->setAttribute("LANGUAGE", item->itemText.defaultStyle().charStyle().language());
ob->setAttribute("startArrowIndex", item->startArrowIndex());
ob->setAttribute("endArrowIndex", item->endArrowIndex());
+ ob->setAttribute("startArrowScale", item->startArrowScale());
+ ob->setAttribute("endArrowScale", item->endArrowScale());
}
Index: scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
===================================================================
--- scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp (revision 15344)
+++ scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp (revision 15345)
@@ -1805,4 +1805,6 @@
docu.writeAttribute("LANGUAGE", item->itemText.defaultStyle().charStyle().language());
docu.writeAttribute("startArrowIndex", item->startArrowIndex());
docu.writeAttribute("endArrowIndex", item->endArrowIndex());
+ docu.writeAttribute("startArrowScale", item->startArrowScale());
+ docu.writeAttribute("endArrowScale", item->endArrowScale());
}
Index: scribus/plugins/fileloader/scribus150format/scribus150format.cpp
===================================================================
--- scribus/plugins/fileloader/scribus150format/scribus150format.cpp (revision 15344)
+++ scribus/plugins/fileloader/scribus150format/scribus150format.cpp (revision 15345)
@@ -2527,6 +2527,8 @@
endArrowIndex = 0;
}
currItem->setEndArrowIndex(endArrowIndex);
+ currItem->setStartArrowScale(attrs.valueAsInt("startArrowScale", 100));
+ currItem->setEndArrowScale(attrs.valueAsInt("endArrowScale", 100));
currItem->NamedLStyle = attrs.valueAsString("NAMEDLST", "");
currItem->isBookmark = attrs.valueAsInt("BOOKMARK");
if ((currItem->isBookmark) && (doc->BookMarks.count() == 0))
Index: scribus/plugins/fileloader/scribus134format/scribus134format_save.cpp
===================================================================
--- scribus/plugins/fileloader/scribus134format/scribus134format_save.cpp (revision 15344)
+++ scribus/plugins/fileloader/scribus134format/scribus134format_save.cpp (revision 15345)
@@ -1538,4 +1538,6 @@
docu.writeAttribute("LANGUAGE", item->itemText.defaultStyle().charStyle().language());
docu.writeAttribute("startArrowIndex", item->startArrowIndex());
docu.writeAttribute("endArrowIndex", item->endArrowIndex());
+ docu.writeAttribute("startArrowScale", item->startArrowScale());
+ docu.writeAttribute("endArrowScale", item->endArrowScale());
}
Index: scribus/plugins/fileloader/scribus134format/scribus134format.cpp
===================================================================
--- scribus/plugins/fileloader/scribus134format/scribus134format.cpp (revision 15344)
+++ scribus/plugins/fileloader/scribus134format/scribus134format.cpp (revision 15345)
@@ -2490,6 +2490,8 @@
endArrowIndex = 0;
}
currItem->setEndArrowIndex(endArrowIndex);
+ currItem->setStartArrowScale(attrs.valueAsInt("startArrowScale", 100));
+ currItem->setEndArrowScale(attrs.valueAsInt("endArrowScale", 100));
currItem->NamedLStyle = attrs.valueAsString("NAMEDLST", "");
currItem->isBookmark = attrs.valueAsInt("BOOKMARK");
if ((currItem->isBookmark) && (doc->BookMarks.count() == 0))
Index: scribus/plugins/svgexplugin/svgexplugin.cpp
===================================================================
--- scribus/plugins/svgexplugin/svgexplugin.cpp (revision 15344)
+++ scribus/plugins/svgexplugin/svgexplugin.cpp (revision 15345)
@@ -1353,6 +1353,7 @@
if (Item->itemType() == PageItem::Line)
{
arrowTrans.translate(0, 0);
+ arrowTrans.scale(Item->startArrowScale() / 100.0, Item->startArrowScale() / 100.0);
if (Item->NamedLStyle.isEmpty())
{
if (Item->lineWidth() != 0.0)
@@ -1377,6 +1378,7 @@
double r = atan2(Start.y()-Vector.y(),Start.x()-Vector.x())*(180.0/M_PI);
arrowTrans.translate(Start.x(), Start.y());
arrowTrans.rotate(r);
+ arrowTrans.scale(Item->startArrowScale() / 100.0, Item->startArrowScale() / 100.0);
if (Item->NamedLStyle.isEmpty())
{
if (Item->lineWidth() != 0.0)
@@ -1517,6 +1519,7 @@
if (Item->itemType() == PageItem::Line)
{
arrowTrans.translate(Item->width(), 0);
+ arrowTrans.scale(Item->endArrowScale() / 100.0, Item->endArrowScale() / 100.0);
if (Item->NamedLStyle.isEmpty())
{
if (Item->lineWidth() != 0.0)
@@ -1540,6 +1543,7 @@
double r = atan2(End.y()-Vector.y(),End.x()-Vector.x())*(180.0/M_PI);
arrowTrans.translate(End.x(), End.y());
arrowTrans.rotate(r);
+ arrowTrans.scale(Item->endArrowScale() / 100.0, Item->endArrowScale() / 100.0);
if (Item->NamedLStyle.isEmpty())
{
if (Item->lineWidth() != 0.0)
Index: scribus/pslib.cpp
===================================================================
--- scribus/pslib.cpp (revision 15344)
+++ scribus/pslib.cpp (revision 15345)
@@ -2016,12 +2016,14 @@
{
QTransform arrowTrans;
arrowTrans.scale(-1,1);
+ arrowTrans.scale(c->startArrowScale() / 100.0, c->startArrowScale() / 100.0);
drawArrow(c, arrowTrans, c->startArrowIndex(), gcr);
}
if (c->endArrowIndex() != 0)
{
QTransform arrowTrans;
arrowTrans.translate(c->width(), 0);
+ arrowTrans.scale(c->endArrowScale() / 100.0, c->endArrowScale() / 100.0);
drawArrow(c, arrowTrans, c->endArrowIndex(), gcr);
}
break;
@@ -2144,6 +2146,7 @@
QTransform arrowTrans;
arrowTrans.translate(Start.x(), Start.y());
arrowTrans.rotate(r);
+ arrowTrans.scale(c->startArrowScale() / 100.0, c->startArrowScale() / 100.0);
drawArrow(c, arrowTrans, c->startArrowIndex(), gcr);
break;
}
@@ -2161,6 +2164,7 @@
QTransform arrowTrans;
arrowTrans.translate(End.x(), End.y());
arrowTrans.rotate(r);
+ arrowTrans.scale(c->endArrowScale() / 100.0, c->endArrowScale() / 100.0);
drawArrow(c, arrowTrans, c->endArrowIndex(), gcr);
break;
}
Index: scribus/pageitem_desaxe.cpp
===================================================================
--- scribus/pageitem_desaxe.cpp (revision 15344)
+++ scribus/pageitem_desaxe.cpp (revision 15345)
@@ -97,6 +97,8 @@
result.insert("line-customstyle", item->customLineStyle());
result.insert("line-start-arrow", toXMLString(item->startArrowIndex()));
result.insert("line-end-arrow", toXMLString(item->endArrowIndex()));
+ result.insert("line-start-arrow-scale", toXMLString(item->startArrowScale()));
+ result.insert("line-end-arrow-scale", toXMLString(item->endArrowScale()));
result.insert("frame-type", toXMLString(item->frameType()));
result.insert("frame-shape", toXMLString(item->shape()));
@@ -1077,6 +1079,8 @@
ruleset.addRule(itemPrefix, SetAttribute<PageItem,const QString&>( & PageItem::setCustomLineStyle, "line-customstyle", dummy )); // see comment above for setItemName
ruleset.addRule(itemPrefix, SetAttributeWithConversion<PageItem,int>( & PageItem::setStartArrowIndex, "line-start-arrow", &parseInt ));
ruleset.addRule(itemPrefix, SetAttributeWithConversion<PageItem,int>( & PageItem::setEndArrowIndex, "line-end-arrow", &parseInt ));
+ ruleset.addRule(itemPrefix, SetAttributeWithConversion<PageItem,int>( & PageItem::setStartArrowScale, "line-start-arrow-scale", &parseInt ));
+ ruleset.addRule(itemPrefix, SetAttributeWithConversion<PageItem,int>( & PageItem::setEndArrowScale, "line-end-arrow-scale", &parseInt ));
ruleset.addRule(itemPrefix, SetAttributeWithConversion<PageItem,int>( & PageItem::setFrameType, "frame-type", &parseInt ));
ruleset.addRule(itemPrefix, SetAttributeWithConversion<PageItem, FPointArray>( & PageItem::setShape, "frame-shape", &parseSVG ));
More information about the scribus-commit
mailing list