Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 3902 → Rev 3903

/branches/Version13x/Scribus/scribus/fileloader.cpp
615,8 → 615,7
int docGc = doc->GroupCounter;
doc->GroupCounter = 0;
Neu = PasteItem(&pg, doc);
Neu->Xpos = Neu->Xpos - pageX + Apage->xOffset();
Neu->Ypos = Neu->Ypos - pageY + Apage->yOffset();
Neu->move(-pageX + Apage->xOffset(), - pageY + Apage->yOffset());
//view->setRedrawBounding(Neu);
Neu->setRedrawBounding();
//Neu->OwnPage = view->OnPage(Neu);
/branches/Version13x/Scribus/scribus/mpalette.cpp
1101,7 → 1101,7
imgDpiY->setEnabled(setter);
}
}
setXY(i->Xpos, i->Ypos);
setXY(i->xPos(), i->yPos());
}
 
void Mpalette::NewSel(int nr)
1853,16 → 1853,16
{
double r = atan2(h-y,w-x)*(180.0/M_PI);
w = sqrt(pow(w-x,2)+pow(h-y,2));
ScApp->view->MoveItem(x - CurItem->Xpos, 0, CurItem, true);
ScApp->view->MoveItem(x - CurItem->xPos(), 0, CurItem, true);
ScApp->view->SizeItem(w, CurItem->Height, CurItem->ItemNr, true);
ScApp->view->RotateItem(r, CurItem->ItemNr);
}
else
{
ma.translate(CurItem->Xpos, CurItem->Ypos);
ma.translate(CurItem->xPos(), CurItem->yPos());
ma.rotate(CurItem->Rot);
if (TopLeft->isChecked())
base = CurItem->Xpos;
base = CurItem->xPos();
if (Center->isChecked())
base = ma.m11() * (CurItem->Width / 2.0) + ma.m21() * (CurItem->Height / 2.0) + ma.dx();
if (TopRight->isChecked())
1915,16 → 1915,16
{
double r = atan2(h-y,w-x)*(180.0/M_PI);
w = sqrt(pow(w-x,2)+pow(h-y,2));
ScApp->view->MoveItem(0, y - CurItem->Ypos, CurItem, true);
ScApp->view->MoveItem(0, y - CurItem->yPos(), CurItem, true);
ScApp->view->SizeItem(w, CurItem->Height, CurItem->ItemNr, true);
ScApp->view->RotateItem(r, CurItem->ItemNr);
}
else
{
ma.translate(CurItem->Xpos, CurItem->Ypos);
ma.translate(CurItem->xPos(), CurItem->yPos());
ma.rotate(CurItem->Rot);
if (TopLeft->isChecked())
base = CurItem->Ypos;
base = CurItem->yPos();
if (Center->isChecked())
base = ma.m22() * (CurItem->Height / 2.0) + ma.m12() * (CurItem->Width / 2.0) + ma.dy();
if (TopRight->isChecked())
2771,7 → 2771,7
b = CurItem->Width;
h = CurItem->Height;
r = CurItem->Rot;
ma.translate(CurItem->Xpos-doc->getXOffsetForPage(CurItem->OwnPage), CurItem->Ypos-doc->getXOffsetForPage(CurItem->OwnPage));
ma.translate(CurItem->xPos()-doc->getXOffsetForPage(CurItem->OwnPage), CurItem->yPos()-doc->getXOffsetForPage(CurItem->OwnPage));
ma.rotate(r);
if (TopLeft->isChecked())
n = FPoint(0.0, 0.0);
/branches/Version13x/Scribus/scribus/selection.h
0,0 → 1,74
/***************************************************************************
copyright : (C) 2005 by Craig Bradney
email : cbradney@zip.com.au
***************************************************************************/
 
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef SELECTION_H
#define SELECTION_H
 
#include <qguardedptr.h>
#include <qobject.h>
#include <qmap.h>
#include <qvaluevector.h>
 
#include "pageitem.h"
 
typedef enum {
GUISelection=0,
NonGUISelection=1,
Delete=2,
CustomStart=10
} SelectionListType;
 
typedef QValueList< QGuardedPtr<PageItem> > SelectionList;
typedef QMap<int, SelectionList > ListOfSelections;
typedef QMap<int, bool> ListBool;
 
class Selection : public QObject
{
Q_OBJECT
public:
Selection();
~Selection();
void setDoc(ScribusDoc*);
QPtrList<PageItem>* requestList();
bool connectItemToGUI(int listNumber);
/**
* Disconnect all items from the GUI slots.
* This should not really be necessary if all things are going ok
* except for within the clearAll function.
* @return
*/
bool disconnectAllItemsFromGUI();
bool addItem(PageItem *item, int listNumber=GUISelection);
bool addGroup();
bool removeItem(PageItem *item, int listNumber=GUISelection);
bool removeGroup();
int count(int listNumber=GUISelection);
bool clear(int listNumber=GUISelection);
void clearAll();
/**
* See if the first selected item is "me", called from an item object with "this".
* @param item
* @return
*/
const bool primarySelectionIsMyself(const PageItem* item, int listNumber);
PageItem *itemAt(int index=0, int listNumber=GUISelection);
protected:
ScribusDoc* m_Doc;
ListOfSelections sellists;
ListBool hasGroupSelection;
};
 
#endif
Property changes:
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Revision
\ No newline at end of property
Index: Version13x/Scribus/scribus/Makefile.am
===================================================================
--- Version13x/Scribus/scribus/Makefile.am (revision 3902)
+++ Version13x/Scribus/scribus/Makefile.am (revision 3903)
@@ -180,6 +180,7 @@
scrpalettebase.cpp \
search.cpp \
seiten.cpp \
+ selection.cpp \
selfield.cpp \
serializer.cpp \
shadebutton.cpp \
@@ -386,6 +387,7 @@
$(INSTALL_DATA) $(srcdir)/scrpalettebase.h $(prefix)/include/scribus/scrpalettebase.h
$(INSTALL_DATA) $(srcdir)/search.h $(prefix)/include/scribus/search.h
$(INSTALL_DATA) $(srcdir)/seiten.h $(prefix)/include/scribus/seiten.h
+ $(INSTALL_DATA) $(srcdir)/selection.h $(prefix)/include/scribus/selection.h
$(INSTALL_DATA) $(srcdir)/selfield.h $(prefix)/include/scribus/selfield.h
$(INSTALL_DATA) $(srcdir)/serializer.h $(prefix)/include/scribus/serializer.h
$(INSTALL_DATA) $(srcdir)/shadebutton.h $(prefix)/include/scribus/shadebutton.h
@@ -566,6 +568,7 @@
-rm -f $(prefix)/include/scribus/scrpalettebase.h
-rm -f $(prefix)/include/scribus/search.h
-rm -f $(prefix)/include/scribus/seiten.h
+ -rm -f $(prefix)/include/scribus/selection.h
-rm -f $(prefix)/include/scribus/selfield.h
-rm -f $(prefix)/include/scribus/serializer.h
-rm -f $(prefix)/include/scribus/shadebutton.h
Index: Version13x/Scribus/scribus/pdflib.cpp
===================================================================
--- Version13x/Scribus/scribus/pdflib.cpp (revision 3902)
+++ Version13x/Scribus/scribus/pdflib.cpp (revision 3903)
@@ -1050,7 +1050,7 @@
if (((ite->fillTransparency() != 0) || (ite->lineTransparency() != 0)) && (Options->Version >= 14))
PutPage(PDF_Transparenz(ite));
if ((ite->isBookmark) && (Options->Bookmarks))
- PDF_Bookmark(ite->BMnr, pag->height() - (ite->Ypos - pag->yOffset()));
+ PDF_Bookmark(ite->BMnr, pag->height() - (ite->yPos() - pag->yOffset()));
if (!ite->printable() || ((ite->itemType() == PageItem::TextFrame) && (!pag->PageNam.isEmpty())))
{
PutPage("Q\n");
@@ -1129,7 +1129,7 @@
PutPage("0 j\n");
break;
}
- PutPage("1 0 0 1 "+FToStr(ite->Xpos - pag->xOffset())+" "+FToStr(pag->height() - (ite->Ypos - pag->yOffset()))+" cm\n");
+ PutPage("1 0 0 1 "+FToStr(ite->xPos() - pag->xOffset())+" "+FToStr(pag->height() - (ite->yPos() - pag->yOffset()))+" cm\n");
if (ite->Rot != 0)
{
double sr = sin(-ite->Rot* M_PI / 180.0);
@@ -1735,7 +1735,7 @@
PutPage("0 j\n");
break;
}
- PutPage("1 0 0 1 "+FToStr(ite->Xpos - mPage->xOffset())+" "+FToStr(mPage->height() - (ite->Ypos - mPage->yOffset()))+" cm\n");
+ PutPage("1 0 0 1 "+FToStr(ite->xPos() - mPage->xOffset())+" "+FToStr(mPage->height() - (ite->yPos() - mPage->yOffset()))+" cm\n");
if (ite->Rot != 0)
{
double sr = sin(-ite->Rot* M_PI / 180.0);
@@ -1857,7 +1857,7 @@
PutPage("0 j\n");
break;
}
- PutPage("1 0 0 1 "+FToStr(ite->Xpos - mPage->xOffset())+" "+FToStr(mPage->height() - (ite->Ypos - mPage->yOffset()))+" cm\n");
+ PutPage("1 0 0 1 "+FToStr(ite->xPos() - mPage->xOffset())+" "+FToStr(mPage->height() - (ite->yPos() - mPage->yOffset()))+" cm\n");
if (ite->Rot != 0)
{
double sr = sin(-ite->Rot* M_PI / 180.0);
@@ -2009,7 +2009,7 @@
PutPage("0 j\n");
break;
}
- PutPage("1 0 0 1 "+FToStr(ite->Xpos - pag->xOffset())+" "+FToStr(pag->height() - (ite->Ypos - pag->yOffset()))+" cm\n");
+ PutPage("1 0 0 1 "+FToStr(ite->xPos() - pag->xOffset())+" "+FToStr(pag->height() - (ite->yPos() - pag->yOffset()))+" cm\n");
if (ite->Rot != 0)
{
double sr = sin(-ite->Rot* M_PI / 180.0);
@@ -2077,7 +2077,7 @@
if (((ite->fillTransparency() != 0) || (ite->lineTransparency() != 0)) && (Options->Version >= 14))
tmp += PDF_Transparenz(ite);
if ((ite->isBookmark) && (Options->Bookmarks))
- PDF_Bookmark(ite->BMnr, pag->height() - (ite->Ypos - pag->yOffset()));
+ PDF_Bookmark(ite->BMnr, pag->height() - (ite->yPos() - pag->yOffset()));
if (!ite->printable() || ((ite->itemType() == PageItem::TextFrame) && (!pag->PageNam.isEmpty())))
{
tmp += "Q\n";
@@ -2158,7 +2158,7 @@
}
if (!embedded)
{
- tmp += "1 0 0 1 "+FToStr(ite->Xpos - pag->xOffset())+" "+FToStr(pag->height() - (ite->Ypos - pag->yOffset()))+" cm\n";
+ tmp += "1 0 0 1 "+FToStr(ite->xPos() - pag->xOffset())+" "+FToStr(pag->height() - (ite->yPos() - pag->yOffset()))+" cm\n";
}
if (ite->Rot != 0)
{
@@ -3600,8 +3600,8 @@
size_t ar = sizeof(tmp) / sizeof(*tmp);
for (uint a = 0; a < ar; ++a)
ind2PDFabr[a] = tmp[a];
- double x = ite->Xpos - ActPageP->xOffset();
- double y = ActPageP->height() - (ite->Ypos - ActPageP->yOffset());
+ double x = ite->xPos() - ActPageP->xOffset();
+ double y = ActPageP->height() - (ite->yPos() - ActPageP->yOffset());
double x2 = x+ite->Width;
double y2 = y-ite->Height;
for (uint d = 0; d < ite->itemText.count(); ++d)
@@ -3882,22 +3882,22 @@
case 0:
break;
case 90:
- x = ite->Xpos - ActPageP->xOffset();
- y2 = ActPageP->height() - (ite->Ypos - ActPageP->yOffset());
+ x = ite->xPos() - ActPageP->xOffset();
+ y2 = ActPageP->height() - (ite->yPos() - ActPageP->yOffset());
x2 = x + ite->Height;
y = y2 + ite->Width;
break;
case 180:
- x = ite->Xpos - ActPageP->xOffset() - ite->Width;
- y2 = ActPageP->height() - (ite->Ypos - ActPageP->yOffset());
- x2 = ite->Xpos - ActPageP->xOffset();
+ x = ite->xPos() - ActPageP->xOffset() - ite->Width;
+ y2 = ActPageP->height() - (ite->yPos() - ActPageP->yOffset());
+ x2 = ite->xPos() - ActPageP->xOffset();
y = y2 + ite->Height;
break;
case 270:
- x = ite->Xpos - ActPageP->xOffset() - ite->Height;
- y2 = ActPageP->height() - (ite->Ypos - ActPageP->yOffset()) - ite->Width;
- x2 = ite->Xpos - ActPageP->xOffset();
- y = ActPageP->height() - (ite->Ypos - ActPageP->yOffset());
+ x = ite->xPos() - ActPageP->xOffset() - ite->Height;
+ y2 = ActPageP->height() - (ite->yPos() - ActPageP->yOffset()) - ite->Width;
+ x2 = ite->xPos() - ActPageP->xOffset();
+ y = ActPageP->height() - (ite->yPos() - ActPageP->yOffset());
break;
}
PutDoc("/Rect [ "+FToStr(x)+" "+FToStr(y2)+" "+FToStr(x2)+" "+FToStr(y)+" ]\n");
@@ -4866,8 +4866,8 @@
bd.Prev = ccb - 1;
ccb++;
bd.Page = PageTree.Kids[tel->OwnPage];
- bd.Recht = QRect(static_cast<int>(tel->Xpos - doc->Pages->at(tel->OwnPage)->xOffset()),
- static_cast<int>(doc->Pages->at(tel->OwnPage)->height() - (tel->Ypos - doc->Pages->at(tel->OwnPage)->yOffset())),
+ bd.Recht = QRect(static_cast<int>(tel->xPos() - doc->Pages->at(tel->OwnPage)->xOffset()),
+ static_cast<int>(doc->Pages->at(tel->OwnPage)->height() - (tel->yPos() - doc->Pages->at(tel->OwnPage)->yOffset())),
static_cast<int>(tel->Width),
static_cast<int>(tel->Height));
Beads.append(bd);
@@ -4880,8 +4880,8 @@
if (tel->OwnPage != -1)
{
bd.Page = PageTree.Kids[tel->OwnPage];
- bd.Recht = QRect(static_cast<int>(tel->Xpos - doc->Pages->at(tel->OwnPage)->xOffset()),
- static_cast<int>(doc->Pages->at(tel->OwnPage)->height() - (tel->Ypos - doc->Pages->at(tel->OwnPage)->yOffset())),
+ bd.Recht = QRect(static_cast<int>(tel->xPos() - doc->Pages->at(tel->OwnPage)->xOffset()),
+ static_cast<int>(doc->Pages->at(tel->OwnPage)->height() - (tel->yPos() - doc->Pages->at(tel->OwnPage)->yOffset())),
static_cast<int>(tel->Width),
static_cast<int>(tel->Height));
Beads.append(bd);
Index: Version13x/Scribus/scribus/frameedit.cpp
===================================================================
--- Version13x/Scribus/scribus/frameedit.cpp (revision 3902)
+++ Version13x/Scribus/scribus/frameedit.cpp (revision 3903)
@@ -363,7 +363,7 @@
if (doc->EditClipMode == 0)
{
FPoint np = FPoint(XSpin->value()/doc->unitRatio(), YSpin->value()/doc->unitRatio());
- FPoint zp = FPoint(view->SelItem.at(0)->Xpos, view->SelItem.at(0)->Ypos);
+ FPoint zp = FPoint(view->SelItem.at(0)->xPos(), view->SelItem.at(0)->yPos());
if (AbsMode->isChecked())
np -= zp;
view->MoveClipPoint(view->SelItem.at(0), np);
@@ -386,7 +386,7 @@
disconnect(XSpin, SIGNAL(valueChanged(int)), this, SLOT(MovePoint()));
disconnect(YSpin, SIGNAL(valueChanged(int)), this, SLOT(MovePoint()));
if (AbsMode->isChecked())
- zp = FPoint(view->SelItem.at(0)->Xpos, view->SelItem.at(0)->Ypos);
+ zp = FPoint(view->SelItem.at(0)->xPos(), view->SelItem.at(0)->yPos());
XSpin->setValue((x + zp.x())*doc->unitRatio());
YSpin->setValue((y + zp.y())*doc->unitRatio());
connect(XSpin, SIGNAL(valueChanged(int)), this, SLOT(MovePoint()));
@@ -395,7 +395,7 @@
void NodePalette::ToggleAbsMode()
{
- FPoint zp = FPoint(view->SelItem.at(0)->Xpos, view->SelItem.at(0)->Ypos);
+ FPoint zp = FPoint(view->SelItem.at(0)->xPos(), view->SelItem.at(0)->yPos());
disconnect(XSpin, SIGNAL(valueChanged(int)), this, SLOT(MovePoint()));
disconnect(YSpin, SIGNAL(valueChanged(int)), this, SLOT(MovePoint()));
double unitRatio=doc->unitRatio();
/branches/Version13x/Scribus/scribus/scribusdoc.cpp
36,6 → 36,7
#include "pageitem_textframe.h"
#include "pagestructs.h"
#include "prefsmanager.h"
#include "selection.h"
#include "undomanager.h"
#include "undostate.h"
#include "units.h"
69,6 → 70,8
 
ScribusDoc::ScribusDoc() : UndoObject( tr("Document"))
{
selection=new Selection();
Q_CHECK_PTR(selection);
ApplicationPrefs* prefsData=&(PrefsManager::instance()->appPrefs);
modified = false;
_itemCreationTransactionStarted=false;
2485,12 → 2488,12
{
FPointArray pb;
pb.resize(0);
pb.addPoint(FPoint(currItem->Xpos, currItem->Ypos));
FPoint p1(currItem->Width, 0.0, currItem->Xpos, currItem->Ypos, currItem->Rot, 1.0, 1.0);
pb.addPoint(FPoint(currItem->xPos(), currItem->yPos()));
FPoint p1(currItem->Width, 0.0, currItem->xPos(), currItem->yPos(), currItem->Rot, 1.0, 1.0);
pb.addPoint(p1);
FPoint p2(currItem->Width, currItem->Height, currItem->Xpos, currItem->Ypos, currItem->Rot, 1.0, 1.0);
FPoint p2(currItem->Width, currItem->Height, currItem->xPos(), currItem->yPos(), currItem->Rot, 1.0, 1.0);
pb.addPoint(p2);
FPoint p3(0.0, currItem->Height, currItem->Xpos, currItem->Ypos, currItem->Rot, 1.0, 1.0);
FPoint p3(0.0, currItem->Height, currItem->xPos(), currItem->yPos(), currItem->Rot, 1.0, 1.0);
pb.addPoint(p3);
for (uint pc = 0; pc < 4; ++pc)
{
2502,10 → 2505,10
}
else
{
minx = QMIN(minx, currItem->Xpos);
miny = QMIN(miny, currItem->Ypos);
maxx = QMAX(maxx, currItem->Xpos + currItem->Width);
maxy = QMAX(maxy, currItem->Ypos + currItem->Height);
minx = QMIN(minx, currItem->xPos());
miny = QMIN(miny, currItem->yPos());
maxx = QMAX(maxx, currItem->xPos() + currItem->Width);
maxy = QMAX(maxy, currItem->yPos() + currItem->Height);
}
}
minPoint.setX(minx);
2554,8 → 2557,8
int y = static_cast<int>(currentPage->yOffset());
int w = static_cast<int>(currentPage->width());
int h = static_cast<int>(currentPage->height());
int x2 = static_cast<int>(currItem->Xpos);
int y2 = static_cast<int>(currItem->Ypos);
int x2 = static_cast<int>(currItem->xPos());
int y2 = static_cast<int>(currItem->yPos());
int w2 = QMAX(static_cast<int>(currItem->Width), 1);
int h2 = QMAX(static_cast<int>(currItem->Height), 1);
if (QRect(x, y, w, h).intersects(QRect(x2, y2, w2, h2)))
2570,8 → 2573,8
int y = static_cast<int>(Pages->at(a)->yOffset());
int w = static_cast<int>(Pages->at(a)->width());
int h = static_cast<int>(Pages->at(a)->height());
int x2 = static_cast<int>(currItem->Xpos);
int y2 = static_cast<int>(currItem->Ypos);
int x2 = static_cast<int>(currItem->xPos());
int y2 = static_cast<int>(currItem->yPos());
int w2 = QMAX(static_cast<int>(currItem->Width), 1);
int h2 = QMAX(static_cast<int>(currItem->Height), 1);
if (QRect(x, y, w, h).intersects(QRect(x2, y2, w2, h2)))
2729,8 → 2732,7
if (moveObjects)
{
oldPg = pageTable[item->OwnPage];
item->Xpos = item->Xpos - oldPg.oldXO + Pages->at(oldPg.newPg)->xOffset();
item->Ypos = item->Ypos - oldPg.oldYO + Pages->at(oldPg.newPg)->yOffset();
item->move(-oldPg.oldXO + Pages->at(oldPg.newPg)->xOffset(), -oldPg.oldYO + Pages->at(oldPg.newPg)->yOffset());
item->OwnPage = static_cast<int>(oldPg.newPg);
}
else
2835,7 → 2837,7
newItem->Frame = true;
if (oldItem->itemType()==PageItem::PathText)
{
uint newPolyItemNo = itemAdd(PageItem::PolyLine, PageItem::Unspecified, currItem->Xpos, currItem->Ypos, currItem->Width, currItem->Height, currItem->Pwidth, "None", currItem->lineColor(), true);
uint newPolyItemNo = itemAdd(PageItem::PolyLine, PageItem::Unspecified, currItem->xPos(), currItem->yPos(), currItem->Width, currItem->Height, currItem->Pwidth, "None", currItem->lineColor(), true);
PageItem *polyLineItem = Items->at(newPolyItemNo);
polyLineItem->PoLine = currItem->PoLine.copy();
polyLineItem->ClipEdited = true;
2890,8 → 2892,8
newItem->UpdatePolyClip();
//FIXME: Stop using the view here
ScApp->view->AdjustItemSize(newItem);
double dx = secondaryItem->Xpos - newItem->Xpos;
double dy = secondaryItem->Ypos - newItem->Ypos;
double dx = secondaryItem->xPos() - newItem->xPos();
double dy = secondaryItem->yPos() - newItem->yPos();
ScApp->view->MoveItem(dx, dy, newItem);
newItem->Rot = secondaryItem->Rot;
newItem->FrameType = 3;
/branches/Version13x/Scribus/scribus/selection.cpp
0,0 → 1,181
/***************************************************************************
copyright : (C) 2005 by Craig Bradney
email : cbradney@zip.com.au
***************************************************************************/
 
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#include "selection.h"
#include "selection.moc"
 
 
 
Selection::Selection()
{
sellists.insert(0, QValueList< QGuardedPtr<PageItem> >()); //Create the default GUI selected item list
hasGroupSelection.insert(0, false);
}
 
 
Selection::~Selection()
{
}
 
void Selection::setDoc(ScribusDoc* doc)
{
m_Doc=doc;
}
 
 
int Selection::count(int listNumber)
{
if (sellists.contains(listNumber))
return sellists[listNumber].count();
return -1;
}
 
bool Selection::clear(int listNumber)
{
if (sellists.contains(listNumber))
{
if (!sellists[listNumber].isEmpty())
{
SelectionList::Iterator itend=sellists[listNumber].end();
SelectionList::Iterator it=sellists[listNumber].begin();
while (it!=itend)
{
(*it)->Select=false;
(*it)->isSingleSel=false;
(*it)->disconnectFromGUI();
++it;
}
}
sellists[listNumber].clear();
hasGroupSelection[listNumber]=false;
qDebug(QString("clearing %1").arg(listNumber));
return true;
}
return false;
}
 
void Selection::clearAll()
{
disconnectAllItemsFromGUI();
ListOfSelections::Iterator itend=sellists.end();
ListOfSelections::Iterator it=sellists.begin();
while (it!=itend)
{
hasGroupSelection[it.key()]=false;
clear(it.key());
++it;
}
}
 
bool Selection::connectItemToGUI(int listNumber)
{
if (sellists.contains(listNumber) && !sellists[listNumber].isEmpty())
if (hasGroupSelection[listNumber]==false)
{
QGuardedPtr<PageItem> pi=sellists[listNumber].first();
//Quick check to see if the pointer is NULL, if its NULL, we should remove it from the list now
if (pi.isNull())
{
//SelectionList::Iterator it=sellists[listNumber].at(0);
sellists[listNumber].remove(pi);
return false;
}
return pi->connectToGUI();
}
return false;
}
 
bool Selection::disconnectAllItemsFromGUI()
{
ListOfSelections::Iterator itend=sellists.end();
ListOfSelections::Iterator it=sellists.begin();
while (it!=itend)
{
int listNumber=it.key();
if (!sellists[listNumber].isEmpty())
{
SelectionList::Iterator it2end=sellists[listNumber].end();
SelectionList::Iterator it2=sellists[listNumber].begin();
while (it2!=it2end)
{
(*it2)->disconnectFromGUI();
++it2;
}
}
++it;
}
//Return true for now...
return true;
}
 
bool Selection::addItem(PageItem *item, int listNumber)
{
if (item==NULL)
return false;
if (sellists.contains(listNumber))
{
bool listIsEmpty=sellists[listNumber].isEmpty();
if (listIsEmpty || !sellists[listNumber].contains(item))
{
if (listIsEmpty && listNumber==0)
item->connectToGUI();
sellists[listNumber].append(item);
item->Select=true;
qDebug(QString("adding %1 %2").arg(listNumber).arg(item->ItemNr));
return true;
}
}
return false;
}
 
bool Selection::removeItem(PageItem *item, int listNumber)
{
if (sellists.contains(listNumber))
if (!sellists[listNumber].isEmpty() && sellists[listNumber].contains(item))
{
bool removeOk=sellists[listNumber].remove(item);
if (removeOk)
{
item->Select=false;
item->isSingleSel = false;
}
if (sellists[listNumber].count()==0)
hasGroupSelection[listNumber]=false;
return removeOk;
}
return false;
}
 
const bool Selection::primarySelectionIsMyself(const PageItem* item, int listNumber)
{
if (sellists.contains(listNumber))
if (!sellists[listNumber].isEmpty() && (item==sellists[listNumber].first()))
return true;
return false;
}
 
PageItem *Selection::itemAt(int index, int listNumber)
{
if (sellists.contains(listNumber))
if (!sellists[listNumber].isEmpty() && static_cast<uint>(index)<sellists[listNumber].count())
{
QGuardedPtr<PageItem> pi=sellists[listNumber][index];
if (!pi.isNull())
return pi;
//If its NULL, we should remove it from the list now
SelectionList::Iterator it=sellists[listNumber].at(index);
sellists[listNumber].remove(it);
return NULL;
}
return NULL;
}
Property changes:
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Revision
\ No newline at end of property
Index: Version13x/Scribus/scribus/scribusXml.cpp
===================================================================
--- Version13x/Scribus/scribus/scribusXml.cpp (revision 3902)
+++ Version13x/Scribus/scribus/scribusXml.cpp (revision 3903)
@@ -221,8 +221,8 @@
if (newFormat)
ob->setAttribute("OwnPage", item->OwnPage);
ob->setAttribute("PTYPE",item->itemType());
- ob->setAttribute("XPOS",item->Xpos);
- ob->setAttribute("YPOS",item->Ypos);
+ ob->setAttribute("XPOS",item->xPos());
+ ob->setAttribute("YPOS",item->yPos());
ob->setAttribute("WIDTH",item->Width);
ob->setAttribute("HEIGHT",item->Height);
ob->setAttribute("RADRECT",item->RadRect);
@@ -2145,8 +2145,8 @@
}
else
{
- xp = item->Xpos - doc->currentPage->xOffset();
- yp = item->Ypos - doc->currentPage->yOffset();
+ xp = item->xPos() - doc->currentPage->xOffset();
+ yp = item->yPos() - doc->currentPage->yOffset();
elem.setAttribute("W", item->Width);
elem.setAttribute("H", item->Height);
}
@@ -2387,8 +2387,8 @@
else
ob.setAttribute("ALIGN",item->textAlignment);
SetItemProps(&ob, item, false);
- ob.setAttribute("XPOS",item->Xpos - doc->currentPage->xOffset());
- ob.setAttribute("YPOS",item->Ypos - doc->currentPage->yOffset());
+ ob.setAttribute("XPOS",item->xPos() - doc->currentPage->xOffset());
+ ob.setAttribute("YPOS",item->yPos() - doc->currentPage->yOffset());
ob.setAttribute("BOOKMARK", item->isBookmark ? 1 : 0);
if (item->effectsInUse.count() != 0)
{
Index: Version13x/Scribus/scribus/pageitem.h
===================================================================
--- Version13x/Scribus/scribus/pageitem.h (revision 3902)
+++ Version13x/Scribus/scribus/pageitem.h (revision 3903)
@@ -257,12 +257,8 @@
void DrawPolyL(QPainter *p, QPointArray pts);
QString ExpandToken(uint base);
bool Reverse;
- /** X-Position auf der Seite */
- double Xpos;
/** @brief Stores the old X-position for undo action. Is used to detect move actions.*/
double oldXpos;
- /** Y-Position auf der Seite */
- double Ypos;
/** @brief Stores the old Y-position for undo action. Is used to detect move actions. */
double oldYpos;
/** Breite des Elements */
@@ -481,6 +477,13 @@
int startArrowIndex;
int endArrowIndex;
bool isEmbedded;
+
+
+ const double xPos();
+ const double yPos();
+ void setXPos(const double);
+ void setYPos(const double);
+ void move(const double, const double);
/** @brief Manages undostack and is where all undo actions/states are sent. */
UndoManager *undoManager;
@@ -876,6 +879,10 @@
*/
bool loadImage(const QString& filename, const bool reload, const int gsResolution=-1);
+
+ bool connectToGUI();
+ bool disconnectFromGUI();
+
protected:
/**
* @name Restore helper methods
@@ -1049,7 +1056,46 @@
QColor fillQColor;
QColor strokeQColor;
+
+ /** X position on the page */
+ double Xpos;
+ /** Y position on the page */
+ double Ypos;
+
+signals:
+ //Frame signals
+ void position(double, double); //X,Y
+ void widthAndHeight(double, double); //W,H
+ void colors(QString, QString, int, int); //lineColor, fillColor, lineShade, fillShade
+ void gradientType(int); //Normal, horizontal, vertical, etc.
+ void rotation(double); //Degrees rotation
+ void transparency(double, double); //fillTransparency, lineTransparency
+ //Shape signals
+ void columns(int, double); //Number, gap
+ void cornerRadius(double); //Corner radius of the shape
+ //Line signals
+ void lineWidth(double);
+ void lineStyleCapJoin(PenStyle, PenCapStyle, PenJoinStyle);
+ //Frame text signals
+ void lineSpacing(double);
+ void textToFrameDistances(double, double, double, double); //left, top, bottom, right: Extra, TExtra, BExtra, RExtra
+ void textKerning(int); //ExtraV
+ void textStyle(int); //Style setting
+ void textFont(QString); //Text font
+ void textSize(int); //Text size
+ void textWidthScale(int); //Scaling width of text, ChScale in mpalette
+ void textHeightScale(int); //Scaling height of text, ChScaleV in mpalette
+ void textBaseLineOffset(int); //Offset from baseline to text
+ void textOutline(int); //Outline
+ void textShadow(int, int); //Shadow
+ void textUnderline(int, int); //Underline
+ void textStrike(int, int); //Strikethrough
+ void textColor(QString, QString, int, int); //itemText.at(i)-> cstroke, ccolor, cshade2, cshade
+ void textFormatting(int); //Underline, subscript, etc
+ //Frame image signals
+ void imageOffsetScale(double, double, double, double);
+
};
#endif
/branches/Version13x/Scribus/scribus/pageitem.cpp
32,6 → 32,7
#include "scpaths.h"
#include "page.h"
#include "scribus.h"
#include "scribusapp.h"
#include "scribusstructs.h"
#include "scribusdoc.h"
#include "prefsmanager.h"
38,6 → 39,7
#include "undomanager.h"
#include "undostate.h"
#include "mpalette.h"
#include "cpalette.h"
 
#include "scconfig.h"
 
51,11 → 53,12
 
PageItem::PageItem(const PageItem & other)
: QObject(other.parent()),
UndoObject(other),
 
// 200 attributes! That is madness, or to quote some famous people from Kriquet:
// "THAT ALL HAS TO GO!"
Reverse(other.Reverse),
Xpos(other.Xpos),
Xpos(other.Xpos),
oldXpos(other.oldXpos),
Ypos(other.Ypos),
oldYpos(other.oldYpos),
67,10 → 70,10
gYpos(other.gYpos),
gWidth(other.gWidth),
gHeight(other.gHeight),
RadRect(other.RadRect),
Rot(other.Rot),
RadRect(other.RadRect),
Rot(other.Rot),
oldRot(other.oldRot),
Doc(other.Doc),
Doc(other.Doc),
GrType(other.GrType),
GrStartX(other.GrStartX),
GrStartY(other.GrStartY),
93,9 → 96,9
TxtStrikeWidth(other.TxtStrikeWidth),
Cols(other.Cols),
ColGap(other.ColGap),
Pwidth(other.Pwidth),
Pwidth(other.Pwidth),
OldPwidth(other.OldPwidth),
PLineArt(other.PLineArt),
PLineArt(other.PLineArt),
PLineEnd(other.PLineEnd),
PLineJoin(other.PLineJoin),
NamedLStyle(other.NamedLStyle),
114,8 → 117,8
Frame(other.Frame),
OwnPage(other.OwnPage),
oldOwnPage(other.oldOwnPage),
pixm(other.pixm),
Pfile(other.Pfile),
pixm(other.pixm),
Pfile(other.Pfile),
Pfile2(other.Pfile2),
Pfile3(other.Pfile3),
IProfile(other.IProfile),
122,29 → 125,29
UseEmbedded(other.UseEmbedded),
EmProfile(other.EmProfile),
IRender(other.IRender),
PicArt(other.PicArt),
PicAvail(other.PicAvail),
LocalScX(other.LocalScX),
LocalScY(other.LocalScY),
LocalX(other.LocalX),
LocalY(other.LocalY),
PicArt(other.PicArt),
PicAvail(other.PicAvail),
LocalScX(other.LocalScX),
LocalScY(other.LocalScY),
LocalX(other.LocalX),
LocalY(other.LocalY),
OrigW(other.OrigW),
OrigH(other.OrigH),
BBoxX(other.BBoxX),
BBoxH(other.BBoxH),
Extra(other.Extra),
BBoxX(other.BBoxX),
BBoxH(other.BBoxH),
Extra(other.Extra),
TExtra(other.TExtra),
BExtra(other.BExtra),
RExtra(other.RExtra),
LineSp(other.LineSp),
LineSp(other.LineSp),
LineSpMode(other.LineSpMode),
CurX(other.CurX),
CurY(other.CurY),
CPos(other.CPos),
itemText(other.itemText),
isBookmark(other.isBookmark),
isBookmark(other.isBookmark),
BMnr(other.BMnr),
isAnnotation(other.isAnnotation),
isAnnotation(other.isAnnotation),
AnType(other.AnType),
AnActType(other.AnActType),
AnAction(other.AnAction),
179,10 → 182,10
AnIPlace(other.AnIPlace),
AnScaleW(other.AnScaleW),
AnFormat(other.AnFormat),
IFont(other.IFont),
ISize(other.ISize),
HasSel(other.HasSel),
FrameOnly(other.FrameOnly),
IFont(other.IFont),
ISize(other.ISize),
HasSel(other.HasSel),
FrameOnly(other.FrameOnly),
BackBox(other.BackBox),
NextBox(other.NextBox),
NextIt(other.NextIt),
233,12 → 236,9
startArrowIndex(other.startArrowIndex),
endArrowIndex(other.endArrowIndex),
isEmbedded(other.isEmbedded),
fillQColor(other.fillQColor),
strokeQColor(other.strokeQColor),
undoManager(other.undoManager),
 
// protected
AnName(other.AnName),
fillColorVal(other.fillColorVal),
lineColorVal(other.lineColorVal),
255,7 → 255,9
textFlowUsesContourLineVal(other.textFlowUsesContourLineVal),
pageItemAttributes(other.pageItemAttributes),
isPrintable(other.isPrintable),
tagged(other.tagged)
tagged(other.tagged),
fillQColor(other.fillQColor),
strokeQColor(other.strokeQColor)
{
}
 
522,6 → 524,35
}
}
 
const double PageItem::xPos()
{
return Xpos;
}
 
const double PageItem::yPos()
{
return Ypos;
}
 
void PageItem::setXPos(const double newXPos)
{
Xpos=newXPos;
}
 
void PageItem::setYPos(const double newYPos)
{
Ypos=newYPos;
}
 
void PageItem::move(const double dX, const double dY)
{
if (dX!=0.0)
Xpos+=dX;
if (dY!=0.0)
Ypos+=dY;
}
 
 
/** Zeichnet das Item */
void PageItem::DrawObj(ScPainter *p, QRect e)
{
3452,3 → 3483,54
void PageItem::handleModeEditKey(QKeyEvent *k, bool &keyRepeat)
{
}
 
bool PageItem::connectToGUI()
{
if (!ScQApp->usingGUI())
return false;
connect(this, SIGNAL(position(double, double )), ScApp->propertiesPalette, SLOT(setXY(double, double)));
connect(this, SIGNAL(widthAndHeight(double, double)), ScApp->propertiesPalette, SLOT(setBH(double, double)));
connect(this, SIGNAL(colors(QString, QString, int, int)), ScApp, SLOT(setCSMenu(QString, QString, int, int)));
connect(this, SIGNAL(colors(QString, QString, int, int)), ScApp->propertiesPalette->Cpal, SLOT(setActFarben(QString, QString, int, int)));
connect(this, SIGNAL(gradientType(int)), ScApp->propertiesPalette->Cpal, SLOT(setActGradient(int)));
connect(this, SIGNAL(rotation(double)), ScApp->propertiesPalette, SLOT(setR(double)));
connect(this, SIGNAL(transparency(double, double)), ScApp->propertiesPalette->Cpal, SLOT(setActTrans(double, double)));
//Shape signals
//Not connected when transferring code: void columns(int, double); //Number, gap
connect(this, SIGNAL(cornerRadius(double)), ScApp->propertiesPalette, SLOT(setRR(double)));
// connect(view, SIGNAL(ItemTextCols(int, double)), propertiesPalette, SLOT(setCols(int, double)));
//Line signals
connect(this, SIGNAL(lineWidth(double)), ScApp->propertiesPalette, SLOT(setSvalue(double)));
connect(this, SIGNAL(imageOffsetScale(double, double, double, double)), ScApp->propertiesPalette, SLOT(setLvalue(double, double, double, double)));
connect(this, SIGNAL(lineStyleCapJoin(PenStyle, PenCapStyle, PenJoinStyle)), ScApp->propertiesPalette, SLOT( setLIvalue(PenStyle, PenCapStyle, PenJoinStyle)));
//Frame text signals
connect(this, SIGNAL(lineSpacing(double)), ScApp->propertiesPalette, SLOT(setLsp(double)));
connect(this, SIGNAL(textToFrameDistances(double, double, double, double)), ScApp->propertiesPalette, SLOT(setDvals(double, double, double, double)));
connect(this, SIGNAL(textKerning(int)), ScApp->propertiesPalette, SLOT(setExtra(int)));
connect(this, SIGNAL(textStyle(int)), ScApp->propertiesPalette, SLOT(setStil(int)));
connect(this, SIGNAL(textStyle(int)), ScApp, SLOT(setStilvalue(int)));
connect(this, SIGNAL(textFont(QString)), ScApp, SLOT(AdjustFontMenu(QString)));
connect(this, SIGNAL(textSize(int)), ScApp->propertiesPalette, SLOT(setSize(int)));
connect(this, SIGNAL(textSize(int)), ScApp, SLOT(setFSizeMenu(int)));
connect(this, SIGNAL(textWidthScale(int)), ScApp->propertiesPalette, SLOT(setTScale(int)));
connect(this, SIGNAL(textHeightScale(int)), ScApp->propertiesPalette, SLOT(setTScaleV(int)));
connect(this, SIGNAL(textBaseLineOffset(int)), ScApp->propertiesPalette, SLOT(setTBase(int)));
connect(this, SIGNAL(textOutline(int)), ScApp->propertiesPalette, SLOT(setOutlineW(int)));
connect(this, SIGNAL(textShadow(int, int )), ScApp->propertiesPalette, SLOT(setShadowOffs(int, int )));
connect(this, SIGNAL(textUnderline(int, int)), ScApp->propertiesPalette, SLOT(setUnderline(int, int)));
connect(this, SIGNAL(textStrike(int, int)), ScApp->propertiesPalette, SLOT(setStrike(int, int)));
connect(this, SIGNAL(textColor(QString, QString, int, int)), ScApp->propertiesPalette, SLOT(setActFarben(QString, QString, int, int)));
connect(this, SIGNAL(textFormatting(int)), ScApp->propertiesPalette, SLOT(setAli(int)));
connect(this, SIGNAL(textFormatting(int)), ScApp, SLOT(setAbsValue(int)));
 
return true;
}
 
bool PageItem::disconnectFromGUI()
{
if (!ScQApp->usingGUI())
return false;
disconnect(this, 0, 0, 0);
return true;
}
/branches/Version13x/Scribus/scribus/scribusdoc.h
44,6 → 44,7
#include "pageitem_textframe.h"
#include "pagestructs.h"
 
 
#ifdef HAVE_CMS
#include CMS_INC
#endif
55,6 → 56,7
class UndoState;
class PDFOptions;
class Hyphenator;
class Selection;
 
 
/**
518,6 → 520,7
QPtrList<PageItem> MasterItems;
QPtrList<PageItem> DocItems;
QPtrList<PageItem> FrameItems;
Selection* selection;
/** Pagewidth */
double pageWidth;
/** Pageheight */
/branches/Version13x/Scribus/scribus/scribusview.cpp
55,6 → 55,7
#include "tree.h"
#include "mpalette.h"
#include "scribusXml.h"
#include "selection.h"
#include "serializer.h"
#include "insertTable.h"
#include "hruler.h"
344,10 → 345,10
nextItem = linkedFramesToShow.at(lks);
while (nextItem != 0)
{
double x11 = nextItem->Xpos;
double y11 = nextItem->Ypos;
double x12 = nextItem->Xpos+nextItem->Width;
double y12 = nextItem->Ypos+nextItem->Height;
double x11 = nextItem->xPos();
double y11 = nextItem->yPos();
double x12 = x11+nextItem->Width;
double y12 = y11+nextItem->Height;
double x1mid = x11+(x12-x11)/2;
double y1mid = y11+(y12-y11)/2;
 
369,12 → 370,12
a1 = a2 = b1 = b2 = 0;
if (nextItem->NextBox!=NULL)
{
double x21 = nextItem->NextBox->Xpos;
double y21 = nextItem->NextBox->Ypos;
double x22 = nextItem->NextBox->Xpos+nextItem->NextBox->Width;
double y22 = nextItem->NextBox->Ypos+nextItem->NextBox->Height;
double x2mid = nextItem->NextBox->Xpos + nextItem->NextBox->Width/2;
double y2mid = nextItem->NextBox->Ypos + nextItem->NextBox->Height/2;
double x21 = nextItem->NextBox->xPos();
double y21 = nextItem->NextBox->yPos();
double x22 = x21+nextItem->NextBox->Width;
double y22 = y21+nextItem->NextBox->Height;
double x2mid = x21 + nextItem->NextBox->Width/2;
double y2mid = y21 + nextItem->NextBox->Height/2;
//x2mid = x21+(x22-x21)/2;
//y2mid = y21+(y22-y21)/2;
 
404,12 → 405,12
 
}
 
FPoint Start(a1-nextItem->Xpos, b1-nextItem->Ypos, nextItem->Xpos, nextItem->Ypos, nextItem->Rot, 1, 1);
//FPoint Start = transformPoint(FPoint(nextItem->Width/2, nextItem->Height), nextItem->Xpos, nextItem->Ypos, nextItem->Rot, 1, 1);
FPoint Start(a1-nextItem->xPos(), b1-nextItem->yPos(), nextItem->xPos(), nextItem->yPos(), nextItem->Rot, 1, 1);
//FPoint Start = transformPoint(FPoint(nextItem->Width/2, nextItem->Height), nextItem->xPos(), nextItem->yPos(), nextItem->Rot, 1, 1);
nextItem = nextItem->NextBox;
if (nextItem != NULL)
{
FPoint End(a2-nextItem->Xpos, b2-nextItem->Ypos, nextItem->Xpos, nextItem->Ypos, nextItem->Rot, 1, 1);
FPoint End(a2-nextItem->xPos(), b2-nextItem->yPos(), nextItem->xPos(), nextItem->yPos(), nextItem->Rot, 1, 1);
//FPoint End = transformPoint(FPoint(nextItem->Width/2, 0), nextItem->Xpos, nextItem->Ypos, nextItem->Rot, 1, 1);
painter->setPen(black, 1.0 / Scale, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
painter->setPenOpacity(1.0);
448,11 → 449,11
}
while (nextItem != 0)
{
FPoint Start(nextItem->Width/2, nextItem->Height, nextItem->Xpos, nextItem->Ypos, nextItem->Rot, 1, 1);
FPoint Start(nextItem->Width/2, nextItem->Height, nextItem->xPos(), nextItem->yPos(), nextItem->Rot, 1, 1);
nextItem = nextItem->NextBox;
if (nextItem != 0)
{
FPoint End(nextItem->Width/2, 0, nextItem->Xpos, nextItem->Ypos, nextItem->Rot, 1, 1);
FPoint End(nextItem->Width/2, 0, nextItem->xPos(), nextItem->yPos(), nextItem->Rot, 1, 1);
painter->setPen(black, 5.0 / Scale, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
painter->setPenOpacity(0.3);
painter->drawLine(Start, End);
543,15 → 544,14
if ((previewMode) && (!currItem->printable()))
continue;
int savedOwnPage = currItem->OwnPage;
double OldX = currItem->Xpos;
double OldY = currItem->Ypos;
double OldX = currItem->xPos();
double OldY = currItem->yPos();
double OldBX = currItem->BoundingX;
double OldBY = currItem->BoundingY;
currItem->OwnPage = page->pageNr();
if (!currItem->ChangedMasterItem)
{
currItem->Xpos = OldX - Mp->xOffset() + page->xOffset();
currItem->Ypos = OldY - Mp->yOffset() + page->yOffset();
currItem->move(-Mp->xOffset() + page->xOffset(), -Mp->yOffset() + page->yOffset());
currItem->BoundingX = OldBX - Mp->xOffset() + page->xOffset();
currItem->BoundingY = OldBY - Mp->yOffset() + page->yOffset();
}
563,8 → 563,8
currItem->OwnPage = savedOwnPage;
if (!currItem->ChangedMasterItem)
{
currItem->Xpos = OldX;
currItem->Ypos = OldY;
currItem->setXPos(OldX);
currItem->setYPos(OldY);
currItem->BoundingX = OldBX;
currItem->BoundingY = OldBY;
}
578,14 → 578,14
continue;
if ((currItem->OwnPage != -1) && (currItem->OwnPage != static_cast<int>(Mp->pageNr())))
continue;
double OldX = currItem->Xpos;
double OldY = currItem->Ypos;
double OldX = currItem->xPos();
double OldY = currItem->yPos();
double OldBX = currItem->BoundingX;
double OldBY = currItem->BoundingY;
if (!currItem->ChangedMasterItem)
{
currItem->Xpos = OldX - Mp->xOffset() + page->xOffset();
currItem->Ypos = OldY - Mp->yOffset() + page->yOffset();
currItem->setXPos(OldX - Mp->xOffset() + page->xOffset());
currItem->setYPos(OldY - Mp->yOffset() + page->yOffset());
currItem->BoundingX = OldBX - Mp->xOffset() + page->xOffset();
currItem->BoundingY = OldBY - Mp->yOffset() + page->yOffset();
}
594,7 → 594,7
{
painter->setZoomFactor(Scale);
painter->save();
painter->translate(currItem->Xpos*Scale, currItem->Ypos*Scale);
painter->translate(currItem->xPos()*Scale, currItem->yPos()*Scale);
painter->rotate(currItem->Rot);
if (currItem->lineColor() != "None")
{
617,8 → 617,8
}
if (!currItem->ChangedMasterItem)
{
currItem->Xpos = OldX;
currItem->Ypos = OldY;
currItem->setXPos(OldX);
currItem->setYPos(OldY);
currItem->BoundingX = OldBX;
currItem->BoundingY = OldBY;
}
694,9 → 694,9
if ((Doc->appMode == modeEdit) && (currItem->Select) && (currItem->itemType() == PageItem::TextFrame))
{
//CB 230305 Stop redrawing the horizontal ruler if it hasnt changed when typing text!!!
if ((qRound(horizRuler->ItemPos*10000) != qRound((currItem->Xpos)*10000)) || (qRound(horizRuler->ItemEndPos*10000) != qRound(((currItem->Xpos+currItem->Width) )*10000)))
if ((qRound(horizRuler->ItemPos*10000) != qRound((currItem->xPos())*10000)) || (qRound(horizRuler->ItemEndPos*10000) != qRound(((currItem->xPos()+currItem->Width) )*10000)))
{
horizRuler->setItemPosition(currItem->Xpos, currItem->Width);
horizRuler->setItemPosition(currItem->xPos(), currItem->Width);
if (currItem->lineColor() != "None")
horizRuler->lineCorr = currItem->Pwidth / 2.0;
else
734,7 → 734,7
{
painter->setZoomFactor(Scale);
painter->save();
painter->translate(currItem->Xpos*Scale, currItem->Ypos*Scale);
painter->translate(currItem->xPos()*Scale, currItem->yPos()*Scale);
painter->rotate(currItem->Rot);
if (currItem->lineColor() != "None")
{
1498,7 → 1498,7
currItem->Select = true;
currItem->FrameType = 3;
currItem->OwnPage = Doc->OnPage(currItem);
emit ItemPos(currItem->Xpos, currItem->Ypos);
emit ItemPos(currItem->xPos(), currItem->yPos());
emit SetSizeValue(currItem->Pwidth);
emit SetLineArt(currItem->PLineArt, currItem->PLineEnd, currItem->PLineJoin);
emit ItemFarben(currItem->lineColor(), currItem->fillColor(), currItem->lineShade(), currItem->fillShade());
1579,7 → 1579,7
nx = npg.x();
ny = npg.y();
}
FPoint np(nx, ny, currItem->Xpos, currItem->Ypos, currItem->Rot, 1, 1, true);
FPoint np(nx, ny, currItem->xPos(), currItem->yPos(), currItem->Rot, 1, 1, true);
MoveClipPoint(currItem, np);
}
AdjustItemSize(currItem);
1956,8 → 1956,8
currItem = SelItem.at(0);
FPoint np1 = FPoint(m->x() / Scale + Doc->minCanvasCoordinate.x(), m->y() / Scale + Doc->minCanvasCoordinate.y());
np1 = ApplyGridF(np1);
currItem->Width = np1.x() - currItem->Xpos;
currItem->Height = np1.y()- currItem->Ypos;
currItem->Width = np1.x() - currItem->xPos();
currItem->Height = np1.y()- currItem->yPos();
FPointArray cli = RegularPolygonF(currItem->Width, currItem->Height, Doc->toolSettings.polyC, Doc->toolSettings.polyS, Doc->toolSettings.polyF, Doc->toolSettings.polyR);
FPoint np = FPoint(cli.point(0));
currItem->PoLine.resize(2);
2089,10 → 2089,10
if (Doc->SnapGuides)
{
ApplyGuides(&nx, &ny);
npx = FPoint(nx, ny, currItem->Xpos, currItem->Ypos, currItem->Rot, 1, 1, true);
npx = FPoint(nx, ny, currItem->xPos(), currItem->yPos(), currItem->Rot, 1, 1, true);
}
else
npx = ApplyGridF(FPoint(nx, ny, currItem->Xpos, currItem->Ypos, currItem->Rot, 1, 1, true));
npx = ApplyGridF(FPoint(nx, ny, currItem->xPos(), currItem->yPos(), currItem->Rot, 1, 1, true));
if ((HowTo == 1) && !(currItem->asLine()) && (Doc->SnapGuides))
SizeItem(npx.x(), npx.y(), currItem->ItemNr);
bool sav = Doc->SnapGuides;
2189,9 → 2189,9
Doc->SnapGuides = sav;
ApplyGuides(&nx, &ny);
Doc->SnapGuides = false;
double r = atan2(ny - currItem->Ypos, nx - currItem->Xpos)*(180.0/M_PI);
double r = atan2(ny - currItem->yPos(), nx - currItem->xPos())*(180.0/M_PI);
RotateItem(r, currItem->ItemNr);
double w = sqrt(pow(nx - currItem->Xpos, 2) + pow(ny - currItem->Ypos,2));
double w = sqrt(pow(nx - currItem->xPos(), 2) + pow(ny - currItem->yPos(),2));
SizeItem(w, currItem->Height, currItem->ItemNr, true);
}
}
2274,13 → 2274,13
ApplyGuides(&nx, &ny);
Doc->SnapGuides = false;
QWMatrix ma;
ma.translate(currItem->Xpos, currItem->Ypos);
ma.translate(currItem->xPos(), currItem->yPos());
ma.rotate(currItem->Rot);
double mx = ma.m11() * currItem->Width + ma.m21() * currItem->Height + ma.dx();
double my = ma.m22() * currItem->Height + ma.m12() * currItem->Width + ma.dy();
double r = atan2(my-ny,mx-nx)*(180.0/M_PI);
double w = sqrt(pow(mx-nx,2)+pow(my-ny,2));
MoveItem(nx - currItem->Xpos, ny - currItem->Ypos, currItem, true);
MoveItem(nx - currItem->xPos(), ny - currItem->yPos(), currItem, true);
SizeItem(w, currItem->Height, currItem->ItemNr, true);
RotateItem(r, currItem->ItemNr);
currItem->Sizing = false;
2645,8 → 2645,8
}
if (Doc->useRaster)
{
double nx = currItem->Xpos;
double ny = currItem->Ypos;
double nx = currItem->xPos();
double ny = currItem->yPos();
if (!ApplyGuides(&nx, &ny))
{
FPoint npx;
2654,7 → 2654,7
nx = npx.x();
ny = npx.y();
}
MoveItem(nx-currItem->Xpos, ny-currItem->Ypos, currItem);
MoveItem(nx-currItem->xPos(), ny-currItem->yPos(), currItem);
}
else
MoveItem(0, 0, currItem, false);
3115,8 → 3115,8
{
QPoint a1 = currItem->PoLine.pointQ(currItem->PoLine.size()-2);
QPoint a2 = currItem->PoLine.pointQ(currItem->PoLine.size()-1);
a1 += QPoint(qRound(currItem->Xpos), qRound(currItem->Ypos));
a2 += QPoint(qRound(currItem->Xpos), qRound(currItem->Ypos));
a1 += QPoint(qRound(currItem->xPos()), qRound(currItem->yPos()));
a2 += QPoint(qRound(currItem->xPos()), qRound(currItem->yPos()));
BezierPoints(&Bez, a1, a2, QPoint(Mxp, Myp), QPoint(Mxp, Myp));
p.drawCubicBezier(Bez);
Bez.setPoint(2, QPoint(newX, newY));
3126,13 → 3126,13
else
{
QPoint a2 = currItem->PoLine.pointQ(currItem->PoLine.size()-1);
a2 += QPoint(qRound(currItem->Xpos), qRound(currItem->Ypos));
a2 += QPoint(qRound(currItem->xPos()), qRound(currItem->yPos()));
if (currItem->PoLine.size() > 2)
{
QPoint a1 = currItem->PoLine.pointQ(currItem->PoLine.size()-2);
QPoint a3 = currItem->PoLine.pointQ(currItem->PoLine.size()-3);
a1 += QPoint(qRound(currItem->Xpos), qRound(currItem->Ypos));
a3 += QPoint(qRound(currItem->Xpos), qRound(currItem->Ypos));
a1 += QPoint(qRound(currItem->xPos()), qRound(currItem->yPos()));
a3 += QPoint(qRound(currItem->xPos()), qRound(currItem->yPos()));
BezierPoints(&Bez, a3, a1, QPoint(Mxp, Myp), a2);
p.drawCubicBezier(Bez);
Bez.setPoint(2, QPoint(newX, newY));
3154,7 → 3154,7
p.setPen(QPen(white, 1, DotLine, FlatCap, MiterJoin));
if (m->state() & ShiftButton)
{
mop = QPoint(m->x(), static_cast<int>((currItem->Ypos + (newX - currItem->Xpos)) * sc));
mop = QPoint(m->x(), static_cast<int>((currItem->yPos() + (newX - currItem->xPos())) * sc));
QCursor::setPos(mapToGlobal(mop));
newY = static_cast<int>(mop.y()/sc);
}
3163,12 → 3163,12
newX = static_cast<int>(qRound(newX / Doc->guidesSettings.minorGrid) * Doc->guidesSettings.minorGrid);
newY = static_cast<int>(qRound(newY / Doc->guidesSettings.minorGrid) * Doc->guidesSettings.minorGrid);
}
p.drawRect(static_cast<int>(currItem->Xpos*sc), static_cast<int>(currItem->Ypos*sc),
static_cast<int>(Mxp*sc-currItem->Xpos*sc), static_cast<int>(Myp*sc-currItem->Ypos*sc));
p.drawRect(static_cast<int>(currItem->Xpos*sc), static_cast<int>(currItem->Ypos*sc),
static_cast<int>(newX*sc-currItem->Xpos*sc), static_cast<int>(newY*sc-currItem->Ypos*sc));
p.drawRect(static_cast<int>(currItem->xPos()*sc), static_cast<int>(currItem->yPos()*sc),
static_cast<int>(Mxp*sc-currItem->xPos()*sc), static_cast<int>(Myp*sc-currItem->yPos()*sc));
p.drawRect(static_cast<int>(currItem->xPos()*sc), static_cast<int>(currItem->yPos()*sc),
static_cast<int>(newX*sc-currItem->xPos()*sc), static_cast<int>(newY*sc-currItem->yPos()*sc));
p.end();
emit ItemGeom(newX - currItem->Xpos, newY - currItem->Ypos);
emit ItemGeom(newX - currItem->xPos(), newY - currItem->yPos());
Mxp = newX;
Myp = newY;
}
3183,11 → 3183,11
newX = static_cast<int>(qRound(newX / Doc->guidesSettings.minorGrid) * Doc->guidesSettings.minorGrid);
newY = static_cast<int>(qRound(newY / Doc->guidesSettings.minorGrid) * Doc->guidesSettings.minorGrid);
}
p.drawLine(static_cast<int>(currItem->Xpos*sc), static_cast<int>(currItem->Ypos*sc), static_cast<int>(Mxp*sc), static_cast<int>(Myp*sc));
p.drawLine(static_cast<int>(currItem->Xpos*sc), static_cast<int>(currItem->Ypos*sc), static_cast<int>(newX*sc), static_cast<int>(newY*sc));
p.drawLine(static_cast<int>(currItem->xPos()*sc), static_cast<int>(currItem->yPos()*sc), static_cast<int>(Mxp*sc), static_cast<int>(Myp*sc));
p.drawLine(static_cast<int>(currItem->xPos()*sc), static_cast<int>(currItem->yPos()*sc), static_cast<int>(newX*sc), static_cast<int>(newY*sc));
p.end();
emit SetAngle(xy2Deg(newX - currItem->Xpos, newY - currItem->Ypos));
emit ItemGeom(sqrt(pow(newX - currItem->Xpos,2)+pow(newY - currItem->Ypos,2)), 0);
emit SetAngle(xy2Deg(newX - currItem->xPos(), newY - currItem->yPos()));
emit ItemGeom(sqrt(pow(newX - currItem->xPos(),2)+pow(newY - currItem->yPos(),2)), 0);
Mxp = newX;
Myp = newY;
}
3267,7 → 3267,7
else
Clip = currItem->PoLine;
p.begin(viewport());
p.translate(static_cast<int>(currItem->Xpos*Scale), static_cast<int>(currItem->Ypos*Scale));
p.translate(static_cast<int>(currItem->xPos()*Scale), static_cast<int>(currItem->yPos()*Scale));
p.rotate(currItem->Rot);
FPoint npfN = FPoint(p.xFormDev(QPoint(newX, newY)));
FPoint npfM = FPoint(p.xFormDev(QPoint(Mxp, Myp)));
3302,7 → 3302,7
else
Clip = currItem->PoLine;
p.begin(viewport());
p.translate(static_cast<int>(currItem->Xpos*Scale), static_cast<int>(currItem->Ypos*Scale));
p.translate(static_cast<int>(currItem->xPos()*Scale), static_cast<int>(currItem->yPos()*Scale));
p.rotate(currItem->Rot);
FPoint npfN = FPoint(p.xFormDev(QPoint(newX, newY)));
FPoint npfM = FPoint(p.xFormDev(QPoint(Mxp, Myp)));
3406,7 → 3406,7
if ((m->state() & ShiftButton) && (!(m->state() & ControlButton)))
{
int nX = qRound(m->x()/sc + Doc->minCanvasCoordinate.x());
mop = QPoint(m->x(), static_cast<int>((currItem->Ypos - Doc->minCanvasCoordinate.y() + (nX - currItem->Xpos)) * sc));
mop = QPoint(m->x(), static_cast<int>((currItem->yPos() - Doc->minCanvasCoordinate.y() + (nX - currItem->xPos())) * sc));
}
else
{
3414,7 → 3414,7
if ((m->state() & ControlButton) && (!(m->state() & ShiftButton)))
{
int nX = qRound(m->x()/sc + Doc->minCanvasCoordinate.x());
mop = QPoint(m->x(), static_cast<int>((currItem->Ypos - Doc->minCanvasCoordinate.y() + ((nX - currItem->Xpos) / currItem->OldB2 * currItem->OldH2)) * sc));
mop = QPoint(m->x(), static_cast<int>((currItem->yPos() - Doc->minCanvasCoordinate.y() + ((nX - currItem->xPos()) / currItem->OldB2 * currItem->OldH2)) * sc));
}
else
mop = QPoint(m->x(), m->y());
3427,18 → 3427,18
{
if ((Doc->useRaster) && (Doc->OnPage(currItem) != -1))
{
dx = currItem->Xpos - int (currItem->Xpos / Doc->guidesSettings.minorGrid) * Doc->guidesSettings.minorGrid;
dy = currItem->Ypos - int (currItem->Ypos / Doc->guidesSettings.minorGrid) * Doc->guidesSettings.minorGrid;
dx = currItem->xPos() - int (currItem->xPos() / Doc->guidesSettings.minorGrid) * Doc->guidesSettings.minorGrid;
dy = currItem->yPos() - int (currItem->yPos() / Doc->guidesSettings.minorGrid) * Doc->guidesSettings.minorGrid;
nx = (qRound(np.x() / Doc->guidesSettings.minorGrid) * Doc->guidesSettings.minorGrid - dx);
ny = (qRound(np.y() / Doc->guidesSettings.minorGrid) * Doc->guidesSettings.minorGrid - dy);
}
if (Doc->SnapGuides)
{
nx += currItem->Xpos;
ny += currItem->Ypos;
nx += currItem->xPos();
ny += currItem->yPos();
ApplyGuides(&nx, &ny);
nx -= currItem->Xpos;
ny -= currItem->Ypos;
nx -= currItem->xPos();
ny -= currItem->yPos();
}
erf = SizeItem(nx, ny, currItem->ItemNr);
}
3460,9 → 3460,9
currItem->Sizing = true;
p.setRasterOp(XorROP);
p.setPen(QPen(white, 1, DotLine, FlatCap, MiterJoin));
p.drawLine(static_cast<int>(currItem->Xpos*sc), static_cast<int>(currItem->Ypos*sc),
p.drawLine(static_cast<int>(currItem->xPos()*sc), static_cast<int>(currItem->yPos()*sc),
static_cast<int>(Mxp*sc), static_cast<int>(Myp*sc));
p.drawLine(static_cast<int>(currItem->Xpos*sc), static_cast<int>(currItem->Ypos*sc),
p.drawLine(static_cast<int>(currItem->xPos()*sc), static_cast<int>(currItem->yPos()*sc),
static_cast<int>(newX*sc), static_cast<int>(newY*sc));
p.end();
}
3488,7 → 3488,7
double nx = np2.x();
double ny = np2.y();
ApplyGuides(&nx, &ny);
p.translate(static_cast<int>(currItem->Xpos), static_cast<int>(currItem->Ypos));
p.translate(static_cast<int>(currItem->xPos()), static_cast<int>(currItem->yPos()));
p.rotate(currItem->Rot);
np2 = p.xFormDev(QPoint(qRound(nx), qRound(ny)));
p.end();
3509,7 → 3509,7
double nx = np2.x();
double ny = np2.y();
ApplyGuides(&nx, &ny);
p.translate(static_cast<int>(currItem->Xpos - Doc->minCanvasCoordinate.x()), static_cast<int>(currItem->Ypos - Doc->minCanvasCoordinate.y()));
p.translate(static_cast<int>(currItem->xPos() - Doc->minCanvasCoordinate.x()), static_cast<int>(currItem->yPos() - Doc->minCanvasCoordinate.y()));
p.rotate(currItem->Rot);
np2 = p.xFormDev(QPoint(qRound(nx), qRound(ny)));
p.end();
3567,14 → 3567,14
moveGroup(newX-Mxp, newY-Myp, false);
if (Doc->SnapGuides)
{
double nx = currItem->Xpos;
double ny = currItem->Ypos;
double nx = currItem->xPos();
double ny = currItem->yPos();
ApplyGuides(&nx, &ny);
moveGroup(nx-currItem->Xpos, ny-currItem->Ypos, false);
nx = currItem->Xpos+currItem->Width;
ny = currItem->Ypos+currItem->Height;
moveGroup(nx-currItem->xPos(), ny-currItem->yPos(), false);
nx = currItem->xPos()+currItem->Width;
ny = currItem->yPos()+currItem->Height;
ApplyGuides(&nx, &ny);
moveGroup(nx-(currItem->Xpos+currItem->Width), ny-(currItem->Ypos+currItem->Height), false);
moveGroup(nx-(currItem->xPos()+currItem->Width), ny-(currItem->yPos()+currItem->Height), false);
}
}
}
4022,8 → 4022,8
else
{
cli.putPoints(0, EndInd-StartInd, Clip, StartInd);
//z = PaintPoly(currItem->Xpos, currItem->Ypos, currItem->Width, currItem->Height, currItem->Pwidth, currItem->fillColor(), currItem->lineColor());
z = Doc->itemAdd(PageItem::Polygon, PageItem::Unspecified, currItem->Xpos, currItem->Ypos, currItem->Width, currItem->Height, currItem->Pwidth, currItem->fillColor(), currItem->lineColor(), !Mpressed);
//z = PaintPoly(currItem->xPos(), currItem->yPos(), currItem->Width, currItem->Height, currItem->Pwidth, currItem->fillColor(), currItem->lineColor());
z = Doc->itemAdd(PageItem::Polygon, PageItem::Unspecified, currItem->xPos(), currItem->yPos(), currItem->Width, currItem->Height, currItem->Pwidth, currItem->fillColor(), currItem->lineColor(), !Mpressed);
bb = Doc->Items->at(z);
if (EditContour)
bb->ContourLine.resize(0);
4077,8 → 4077,8
{
if ((ClRe > 1) && (ClRe < static_cast<int>(Clip.size()-2)))
{
//z = PaintPolyLine(currItem->Xpos, currItem->Ypos, currItem->Width, currItem->Height, currItem->Pwidth, currItem->fillColor(), currItem->lineColor());
z = Doc->itemAdd(PageItem::PolyLine, PageItem::Unspecified, currItem->Xpos, currItem->Ypos, currItem->Width, currItem->Height, currItem->Pwidth, currItem->fillColor(), currItem->lineColor(), !Mpressed);
//z = PaintPolyLine(currItem->xPos(), currItem->yPos(), currItem->Width, currItem->Height, currItem->Pwidth, currItem->fillColor(), currItem->lineColor());
z = Doc->itemAdd(PageItem::PolyLine, PageItem::Unspecified, currItem->xPos(), currItem->yPos(), currItem->Width, currItem->Height, currItem->Pwidth, currItem->fillColor(), currItem->lineColor(), !Mpressed);
bb = Doc->Items->at(z);
if (EditContour)
bb->ContourLine.putPoints(0, Clip.size()-(ClRe+2), Clip, ClRe+2);
4275,6 → 4275,7
SeleItem(m);
if (SelItem.count() != 0)
{
 
currItem = SelItem.at(0);
p.begin(viewport());
Transform(currItem, &p);
4468,7 → 4469,7
SelItem.append(currItem);
currItem->paintObj();
Imoved = true;
emit ItemPos(currItem->Xpos, currItem->Ypos);
emit ItemPos(currItem->xPos(), currItem->yPos());
emit SetSizeValue(currItem->Pwidth);
emit SetLineArt(currItem->PLineArt, currItem->PLineEnd, currItem->PLineJoin);
emit ItemFarben(currItem->lineColor(), currItem->fillColor(), currItem->lineShade(), currItem->fillShade());
4503,27 → 4504,27
p.begin(viewport());
Transform(currItem, &p);
Doc->RotMode = 2;
RCenter = FPoint(currItem->Xpos+currItem->Width/2, currItem->Ypos+currItem->Height/2, 0, 0, currItem->Rot, 1, 1, true);
RCenter = FPoint(currItem->xPos()+currItem->Width/2, currItem->yPos()+currItem->Height/2, 0, 0, currItem->Rot, 1, 1, true);
if (QRegion(p.xForm(QPointArray(QRect(0, 0, static_cast<int>(currItem->Width), static_cast<int>(currItem->Height))))).contains(mpo))
{
if (p.xForm(QRect(static_cast<int>(currItem->Width)-6, static_cast<int>(currItem->Height)-6, 6, 6)).intersects(mpo))
{
RCenter = FPoint(currItem->Xpos, currItem->Ypos);
RCenter = FPoint(currItem->xPos(), currItem->yPos());
Doc->RotMode = 0;
}
if (p.xForm(QRect(0, 0, 6, 6)).intersects(mpo))
{
RCenter = FPoint(currItem->Xpos+currItem->Width, currItem->Ypos+currItem->Height, 0, 0, currItem->Rot, 1, 1, true);
RCenter = FPoint(currItem->xPos()+currItem->Width, currItem->yPos()+currItem->Height, 0, 0, currItem->Rot, 1, 1, true);
Doc->RotMode = 4;
}
if (p.xForm(QRect(0, static_cast<int>(currItem->Height)-6, 6, 6)).intersects(mpo))
{
RCenter = FPoint(currItem->Xpos+currItem->Width, currItem->Ypos, 0, 0, currItem->Rot, 1, 1, true);
RCenter = FPoint(currItem->xPos()+currItem->Width, currItem->yPos(), 0, 0, currItem->Rot, 1, 1, true);
Doc->RotMode = 1;
}
if (p.xForm(QRect(static_cast<int>(currItem->Width)-6, 0, 6, 6)).intersects(mpo))
{
RCenter = FPoint(currItem->Xpos, currItem->Ypos+currItem->Height, 0, 0, currItem->Rot, 1, 1, true);
RCenter = FPoint(currItem->xPos(), currItem->yPos()+currItem->Height, 0, 0, currItem->Rot, 1, 1, true);
Doc->RotMode = 3;
}
oldW = xy2Deg(m->x()/Scale - RCenter.x(), m->y()/Scale - RCenter.y());
4617,7 → 4618,7
SelItem.append(currItem);
currItem->paintObj();
Imoved = true;
emit ItemPos(currItem->Xpos, currItem->Ypos);
emit ItemPos(currItem->xPos(), currItem->yPos());
emit SetSizeValue(currItem->Pwidth);
emit SetLineArt(currItem->PLineArt, currItem->PLineEnd, currItem->PLineJoin);
emit ItemFarben(currItem->lineColor(), currItem->fillColor(), currItem->lineShade(), currItem->fillShade());
4662,7 → 4663,7
SizeItem(currItem->PoLine.WidthHeight().x(), currItem->PoLine.WidthHeight().y(), currItem->ItemNr, false, false, false);
currItem->SetPolyClip(qRound(QMAX(currItem->Pwidth / 2, 1)));
currItem->paintObj();
emit ItemPos(currItem->Xpos, currItem->Ypos);
emit ItemPos(currItem->xPos(), currItem->yPos());
emit SetSizeValue(currItem->Pwidth);
emit SetLineArt(currItem->PLineArt, currItem->PLineEnd, currItem->PLineJoin);
emit ItemFarben(currItem->lineColor(), currItem->fillColor(), currItem->lineShade(), currItem->fillShade());
4847,29 → 4848,29
{
for (uint yg = 0; yg < page->YGuides.count(); ++yg)
{
if ((page->YGuides[yg]+page->yOffset() < (currItem->Ypos+Doc->guidesSettings.guideRad)) && (page->YGuides[yg]+page->yOffset() > (currItem->Ypos-Doc->guidesSettings.guideRad)))
if ((page->YGuides[yg]+page->yOffset() < (currItem->yPos()+Doc->guidesSettings.guideRad)) && (page->YGuides[yg]+page->yOffset() > (currItem->yPos()-Doc->guidesSettings.guideRad)))
{
currItem->Ypos = page->YGuides[yg]+page->yOffset();
currItem->setYPos(page->YGuides[yg]+page->yOffset());
break;
}
if (currItem->asLine())
{
QWMatrix ma;
ma.translate(currItem->Xpos, currItem->Ypos);
ma.translate(currItem->xPos(), currItem->yPos());
ma.rotate(currItem->Rot);
double my = ma.m22() * currItem->Height + ma.m12() * currItem->Width + ma.dy();
if ((page->YGuides[yg]+page->yOffset() < (my+Doc->guidesSettings.guideRad)) && (page->YGuides[yg]+page->yOffset() > (my-Doc->guidesSettings.guideRad)))
{
currItem->Ypos = currItem->Ypos + page->YGuides[yg] - my + page->yOffset();
currItem->move(0.0, page->YGuides[yg] - my + page->yOffset());
break;
}
}
else
{
if ((page->YGuides[yg]+page->yOffset() < (currItem->Ypos+currItem->Height+Doc->guidesSettings.guideRad)) &&
(page->YGuides[yg]+page->yOffset() > ((currItem->Ypos+currItem->Height)-Doc->guidesSettings.guideRad)))
if ((page->YGuides[yg]+page->yOffset() < (currItem->yPos()+currItem->Height+Doc->guidesSettings.guideRad)) &&
(page->YGuides[yg]+page->yOffset() > ((currItem->yPos()+currItem->Height)-Doc->guidesSettings.guideRad)))
{
currItem->Ypos = page->YGuides[yg]-currItem->Height+page->yOffset();
currItem->setYPos(page->YGuides[yg]-currItem->Height+page->yOffset());
break;
}
}
4879,29 → 4880,29
{
for (uint xg = 0; xg < page->XGuides.count(); ++xg)
{
if ((page->XGuides[xg]+page->xOffset() < (currItem->Xpos+Doc->guidesSettings.guideRad)) && (page->XGuides[xg]+page->xOffset() > (currItem->Xpos-Doc->guidesSettings.guideRad)))
if ((page->XGuides[xg]+page->xOffset() < (currItem->xPos()+Doc->guidesSettings.guideRad)) && (page->XGuides[xg]+page->xOffset() > (currItem->xPos()-Doc->guidesSettings.guideRad)))
{
currItem->Xpos = page->XGuides[xg]+page->xOffset();
currItem->setXPos(page->XGuides[xg]+page->xOffset());
break;
}
if (currItem->asLine())
{
QWMatrix ma;
ma.translate(currItem->Xpos, currItem->Ypos);
ma.translate(currItem->xPos(), currItem->yPos());
ma.rotate(currItem->Rot);
double mx = ma.m11() * currItem->Width + ma.m21() * currItem->Height + ma.dx();
if ((page->XGuides[xg]+page->xOffset() < (mx+Doc->guidesSettings.guideRad)) && (page->XGuides[xg]+page->xOffset() > (mx-Doc->guidesSettings.guideRad)))
{
currItem->Xpos = currItem->Xpos + page->XGuides[xg] - mx + page->xOffset();
currItem->move(page->XGuides[xg] - mx + page->xOffset(), 0.0);
break;
}
}
else
{
if ((page->XGuides[xg]+page->xOffset() < (currItem->Xpos+currItem->Width+Doc->guidesSettings.guideRad)) &&
(page->XGuides[xg]+page->xOffset() > ((currItem->Xpos+currItem->Width)-Doc->guidesSettings.guideRad)))
if ((page->XGuides[xg]+page->xOffset() < (currItem->xPos()+currItem->Width+Doc->guidesSettings.guideRad)) &&
(page->XGuides[xg]+page->xOffset() > ((currItem->xPos()+currItem->Width)-Doc->guidesSettings.guideRad)))
{
currItem->Xpos = page->XGuides[xg]-currItem->Width+page->xOffset();
currItem->setXPos(page->XGuides[xg]-currItem->Width+page->xOffset());
break;
}
}
4958,10 → 4959,10
if (currItem->Rot != 0)
{
FPointArray pb(4);
pb.setPoint(0, FPoint(currItem->Xpos, currItem->Ypos));
pb.setPoint(1, FPoint(currItem->Width, 0.0, currItem->Xpos, currItem->Ypos, currItem->Rot, 1.0, 1.0));
pb.setPoint(2, FPoint(currItem->Width, currItem->Height, currItem->Xpos, currItem->Ypos, currItem->Rot, 1.0, 1.0));
pb.setPoint(3, FPoint(0.0, currItem->Height, currItem->Xpos, currItem->Ypos, currItem->Rot, 1.0, 1.0));
pb.setPoint(0, FPoint(currItem->xPos(), currItem->yPos()));
pb.setPoint(1, FPoint(currItem->Width, 0.0, currItem->xPos(), currItem->yPos(), currItem->Rot, 1.0, 1.0));
pb.setPoint(2, FPoint(currItem->Width, currItem->Height, currItem->xPos(), currItem->yPos(), currItem->Rot, 1.0, 1.0));
pb.setPoint(3, FPoint(0.0, currItem->Height, currItem->xPos(), currItem->yPos(), currItem->Rot, 1.0, 1.0));
for (uint pc = 0; pc < 4; ++pc)
{
minx = QMIN(minx, pb.point(pc).x());
4972,10 → 4973,10
}
else
{
minx = QMIN(minx, currItem->Xpos);
miny = QMIN(miny, currItem->Ypos);
maxx = QMAX(maxx, currItem->Xpos + currItem->Width);
maxy = QMAX(maxy, currItem->Ypos + currItem->Height);
minx = QMIN(minx, currItem->xPos());
miny = QMIN(miny, currItem->yPos());
maxx = QMAX(maxx, currItem->xPos() + currItem->Width);
maxy = QMAX(maxy, currItem->yPos() + currItem->Height);
}
}
GroupX = minx;
5064,18 → 5065,17
if (currItem->locked())
return false;
bool retw = false;
double oldx = currItem->Xpos;
double oldy = currItem->Ypos;
currItem->Xpos += newX;
currItem->Ypos += newY;
double oldx = currItem->xPos();
double oldy = currItem->yPos();
currItem->move(newX, newY);
if ((Doc->useRaster) && (!Imoved) && (!fromMP) && (static_cast<int>(Doc->currentPage->pageNr()) == currItem->OwnPage))
{
currItem->Xpos = qRound(currItem->Xpos / Doc->guidesSettings.minorGrid) * Doc->guidesSettings.minorGrid;
currItem->Ypos = qRound(currItem->Ypos / Doc->guidesSettings.minorGrid) * Doc->guidesSettings.minorGrid;
currItem->setXPos(qRound(currItem->xPos() / Doc->guidesSettings.minorGrid) * Doc->guidesSettings.minorGrid);
currItem->setYPos(qRound(currItem->yPos() / Doc->guidesSettings.minorGrid) * Doc->guidesSettings.minorGrid);
}
if ((Doc->SnapGuides) && (!Imoved) && (Doc->appMode == modeNormal) && (!Doc->EditClip) && (!fromMP))
SnapToGuides(currItem);
if ((currItem->Xpos != oldx) || (currItem->Ypos != oldy))
if ((currItem->xPos() != oldx) || (currItem->yPos() != oldy))
retw = true;
if (!fromMP)
{
5088,7 → 5088,7
}
else */
if (!GroupSel)
emit ItemPos(currItem->Xpos, currItem->Ypos);
emit ItemPos(currItem->xPos(), currItem->yPos());
}
/* if (!Doc->loading)
emit UpdtObj(Doc->currentPage->pageNr(), b->ItemNr); */
5591,7 → 5591,7
}
return;
}
FPoint oldPos = FPoint(currItem->Xpos, currItem->Ypos);
FPoint oldPos = FPoint(currItem->xPos(), currItem->yPos());
double offsX = currItem->Width / 2.0;
double offsY = currItem->Height / 2.0;
ma.translate(-offsX, -offsY);
6000,7 → 6000,7
return true;
QPainter p;
p.begin(viewport());
QPoint in = QPoint(qRound((currItem->Xpos-Doc->minCanvasCoordinate.x())*Scale), qRound((currItem->Ypos-Doc->minCanvasCoordinate.y())*Scale));
QPoint in = QPoint(qRound((currItem->xPos()-Doc->minCanvasCoordinate.x())*Scale), qRound((currItem->yPos()-Doc->minCanvasCoordinate.y())*Scale));
QPoint out = contentsToViewport(in);
p.translate(out.x(), out.y());
p.scale(Scale, Scale);
6058,10 → 6058,10
void ScribusView::MoveRotated(PageItem *currItem, FPoint npv, bool fromMP)
{
QWMatrix ma;
ma.translate(currItem->Xpos, currItem->Ypos);
ma.translate(currItem->xPos(), currItem->yPos());
ma.rotate(currItem->Rot);
double mxc = currItem->Xpos - (ma.m11() * npv.x() + ma.m21() * npv.y() + ma.dx());
double myc = currItem->Ypos - (ma.m22() * npv.y() + ma.m12() * npv.x() + ma.dy());
double mxc = currItem->xPos() - (ma.m11() * npv.x() + ma.m21() * npv.y() + ma.dx());
double myc = currItem->yPos() - (ma.m22() * npv.y() + ma.m12() * npv.x() + ma.dy());
MoveItem(-mxc, -myc, currItem, fromMP);
}
 
6072,19 → 6072,19
if (currItem->asLine())
{
QWMatrix ma;
ma.translate(currItem->Xpos, currItem->Ypos);
ma.translate(currItem->xPos(), currItem->yPos());
ma.rotate(currItem->Rot);
double mx = ma.m11() * currItem->Width + ma.dx();
double my = ma.m12() * currItem->Width + ma.dy();
MoveItem(newX.x(), newX.y(), currItem, fromMP);
currItem->Rot = xy2Deg(mx - currItem->Xpos, my - currItem->Ypos);
currItem->Width = sqrt(pow(mx - currItem->Xpos,2)+pow(my - currItem->Ypos,2));
currItem->Rot = xy2Deg(mx - currItem->xPos(), my - currItem->yPos());
currItem->Width = sqrt(pow(mx - currItem->xPos(),2)+pow(my - currItem->yPos(),2));
currItem->Height = 1;
UpdateClip(currItem);
setRedrawBounding(currItem);
QRect newR(currItem->getRedrawBounding(Scale));
updateContents(newR.unite(oldR));
emit ItemPos(currItem->Xpos, currItem->Ypos);
emit ItemPos(currItem->xPos(), currItem->yPos());
emit ItemGeom(currItem->Width, currItem->Height);
emit SetAngle(currItem->Rot);
}
6096,10 → 6096,10
{
FPoint npv = FPoint(newX.x(), newX.y());
QWMatrix ma3;
ma3.translate(currItem->Xpos, currItem->Ypos);
ma3.translate(currItem->xPos(), currItem->yPos());
ma3.rotate(currItem->Rot);
double mxc3 = currItem->Xpos - (ma3.m11() * npv.x() + ma3.m21() * npv.y() + ma3.dx());
double myc3 = currItem->Ypos - (ma3.m22() * npv.y() + ma3.m12() * npv.x() + ma3.dy());
double mxc3 = currItem->xPos() - (ma3.m11() * npv.x() + ma3.m21() * npv.y() + ma3.dx());
double myc3 = currItem->yPos() - (ma3.m22() * npv.y() + ma3.m12() * npv.x() + ma3.dy());
SizeItem(currItem->Width - newY.x(), currItem->Height - newY.y(), ite, fromMP, true, false);
MoveItem(-mxc3, -myc3, currItem, fromMP);
}
6134,7 → 6134,7
{
p.begin(viewport());
ToView(&p);
p.translate(qRound(currItem->Xpos*Scale), qRound(currItem->Ypos*sc));
p.translate(qRound(currItem->xPos()*Scale), qRound(currItem->yPos()*sc));
p.scale(sc, sc);
p.rotate(currItem->Rot);
p.setRasterOp(XorROP);
6154,7 → 6154,7
{
p.begin(viewport());
ToView(&p);
p.translate(qRound(currItem->Xpos*sc), qRound(currItem->Ypos*sc));
p.translate(qRound(currItem->xPos()*sc), qRound(currItem->yPos()*sc));
p.scale(sc, sc);
p.rotate(currItem->Rot);
p.setRasterOp(XorROP);
6229,9 → 6229,9
for (uint a = 0; a < SelItem.count(); ++a)
{
currItem = SelItem.at(a);
n = FPoint(currItem->Xpos - RCenter.x(), currItem->Ypos - RCenter.y());
currItem->Xpos = ma.m11() * n.x() + ma.m21() * n.y() + ma.dx();
currItem->Ypos = ma.m22() * n.y() + ma.m12() * n.x() + ma.dy();
n = FPoint(currItem->xPos() - RCenter.x(), currItem->yPos() - RCenter.y());
currItem->setXPos(ma.m11() * n.x() + ma.m21() * n.y() + ma.dx());
currItem->setYPos(ma.m22() * n.y() + ma.m12() * n.x() + ma.dy());
currItem->Rot += win;
setRedrawBounding(currItem);
}
6287,13 → 6287,13
gr.addPoint(bb->GrStartX, bb->GrStartY);
gr.addPoint(bb->GrEndX, bb->GrEndY);
FPoint g(gx, gy);
FPoint b(0, 0, bb->Xpos, bb->Ypos, bb->Rot, 1, 1);
FPoint b(0, 0, bb->xPos(), bb->yPos(), bb->Rot, 1, 1);
b -= g;
FPoint b1(b.x(), b.y(), 0, 0, 0, scx, scy);
FPoint t(bb->Width, 0, bb->Xpos, bb->Ypos, bb->Rot, 1, 1);
FPoint t(bb->Width, 0, bb->xPos(), bb->yPos(), bb->Rot, 1, 1);
t -= g;
FPoint t1(t.x(), t.y(), 0, 0, 0, scx, scy);
FPoint h(0, bb->Height, bb->Xpos, bb->Ypos, bb->Rot, 1, 1);
FPoint h(0, bb->Height, bb->xPos(), bb->yPos(), bb->Rot, 1, 1);
h -= g;
FPoint h1(h.x(), h.y(), 0, 0, 0, scx, scy);
bb->Pwidth = QMAX(bb->Pwidth*((scx+scy)/2), 0.01);
6301,17 → 6301,17
{
bb->Rot = atan2(t1.y()-b1.y(),t1.x()-b1.x())*(180.0/M_PI);
bb->Width = sqrt(pow(t1.x()-b1.x(),2)+pow(t1.y()-b1.y(),2));
bb->Xpos = b1.x()+gx;
bb->Ypos = b1.y()+gy;
bb->setXPos(b1.x()+gx);
bb->setYPos(b1.y()+gy);
}
else
{
FPoint oldPos(bb->Xpos, bb->Ypos);
FPoint oldPos(bb->xPos(), bb->yPos());
QWMatrix ma;
ma.rotate(bb->Rot);
bb->PoLine.map(ma);
QWMatrix ma2;
ma2.translate(gx-bb->Xpos, gy-bb->Ypos);
ma2.translate(gx-bb->xPos(), gy-bb->yPos());
ma2.scale(scx, scy);
bb->PoLine.map(ma2);
bb->Rot = 0;
6419,7 → 6419,7
if ((Doc->RotMode != 0) && !(currItem->asLine()))
{
QWMatrix ma;
ma.translate(currItem->Xpos, currItem->Ypos);
ma.translate(currItem->xPos(), currItem->yPos());
ma.scale(1, 1);
ma.rotate(currItem->Rot);
double ro = win-currItem->Rot;
6449,7 → 6449,7
double y = ma.m22() * n.y() + ma.m12() * n.x() + ma.dy();
bool oldS = currItem->Sizing;
currItem->Sizing = true;
MoveItem(x-currItem->Xpos, y-currItem->Ypos, currItem);
MoveItem(x-currItem->xPos(), y-currItem->yPos(), currItem);
currItem->Sizing = oldS;
}
else
7136,12 → 7136,11
if (currItem->LayerNr == Doc->activeLayer())
{
p.begin(this);
double OldX = currItem->Xpos;
double OldY = currItem->Ypos;
double OldX = currItem->xPos();
double OldY = currItem->yPos();
if (!currItem->ChangedMasterItem)
{
currItem->Xpos = OldX - Mp->xOffset() + Doc->currentPage->xOffset();
currItem->Ypos = OldY - Mp->yOffset() + Doc->currentPage->yOffset();
currItem->move(-Mp->xOffset() + Doc->currentPage->xOffset(), -Mp->yOffset() + Doc->currentPage->yOffset());
}
Transform(currItem, &p);
if ((QRegion(p.xForm(QPointArray(QRect(0, 0, static_cast<int>(currItem->Width), static_cast<int>(currItem->Height))))).contains(mpo)) ||
7234,8 → 7233,8
p.end();
if (!currItem->ChangedMasterItem)
{
currItem->Xpos = OldX;
currItem->Ypos = OldY;
currItem->setXPos(OldX);
currItem->setYPos(OldY);
}
return true;
}
7242,8 → 7241,8
p.end();
if (!currItem->ChangedMasterItem)
{
currItem->Xpos = OldX;
currItem->Ypos = OldY;
currItem->setXPos(OldX);
currItem->setYPos(OldY);
}
}
currItem = Doc->currentPage->FromMaster.prev();
7333,6 → 7332,8
currItem->Select = true;
currItem->FrameOnly = true;
currItem->paintObj();
//Doc->selection.addItem(currItem);
}
}
else
7452,12 → 7453,12
PaintSizeRect(p, ne);
double d1;
QMap<double,int> distance;
FPoint n1(currItem->Width, currItem->Height, currItem->Xpos, currItem->Ypos, currItem->Rot, 1, 1);
FPoint n1(currItem->Width, currItem->Height, currItem->xPos(), currItem->yPos(), currItem->Rot, 1, 1);
n1 -= QPoint(qRound(Doc->minCanvasCoordinate.x()), qRound(Doc->minCanvasCoordinate.y()));
d1 = sqrt(pow(n1.x() * Scale - m->x(),2)+pow(n1.y() * Scale - m->y(),2));
if (d1 < Doc->guidesSettings.grabRad)
distance.insert(d1, 1);
n1 = FPoint(0, 0, currItem->Xpos, currItem->Ypos, currItem->Rot, 1, 1);
n1 = FPoint(0, 0, currItem->xPos(), currItem->yPos(), currItem->Rot, 1, 1);
n1 -= QPoint(qRound(Doc->minCanvasCoordinate.x()), qRound(Doc->minCanvasCoordinate.y()));
d1 = sqrt(pow(n1.x() * Scale - m->x(),2)+pow(n1.y() * Scale - m->y(),2));
if (d1 < Doc->guidesSettings.grabRad)
7465,32 → 7466,32
if (!currItem->asLine())
{
QPoint docMinCanvasCoordinate(qRound(Doc->minCanvasCoordinate.x()), qRound(Doc->minCanvasCoordinate.y()));
n1 = FPoint(currItem->Width, 0, currItem->Xpos, currItem->Ypos, currItem->Rot, 1, 1);
n1 = FPoint(currItem->Width, 0, currItem->xPos(), currItem->yPos(), currItem->Rot, 1, 1);
n1 -= docMinCanvasCoordinate;
d1 = sqrt(pow(n1.x() * Scale - m->x(),2)+pow(n1.y() * Scale - m->y(),2));
if (d1 < Doc->guidesSettings.grabRad)
distance.insert(d1, 3);
n1 = FPoint(0, currItem->Height, currItem->Xpos, currItem->Ypos, currItem->Rot, 1, 1);
n1 = FPoint(0, currItem->Height, currItem->xPos(), currItem->yPos(), currItem->Rot, 1, 1);
n1 -= docMinCanvasCoordinate;
d1 = sqrt(pow(n1.x() * Scale - m->x(),2)+pow(n1.y() * Scale - m->y(),2));
if (d1 < Doc->guidesSettings.grabRad)
distance.insert(d1, 4);
n1 = FPoint(currItem->Width/2, currItem->Height, currItem->Xpos, currItem->Ypos, currItem->Rot, 1, 1);
n1 = FPoint(currItem->Width/2, currItem->Height, currItem->xPos(), currItem->yPos(), currItem->Rot, 1, 1);
n1 -= docMinCanvasCoordinate;
d1 = sqrt(pow(n1.x() * Scale - m->x(),2)+pow(n1.y() * Scale - m->y(),2));
if (d1 < Doc->guidesSettings.grabRad)
distance.insert(d1, 5);
n1 = FPoint(currItem->Width, currItem->Height/2, currItem->Xpos, currItem->Ypos, currItem->Rot, 1, 1);
n1 = FPoint(currItem->Width, currItem->Height/2, currItem->xPos(), currItem->yPos(), currItem->Rot, 1, 1);
n1 -= docMinCanvasCoordinate;
d1 = sqrt(pow(n1.x() * Scale - m->x(),2)+pow(n1.y() * Scale - m->y(),2));
if (d1 < Doc->guidesSettings.grabRad)
distance.insert(d1, 6);
n1 = FPoint(0, currItem->Height/2, currItem->Xpos, currItem->Ypos, currItem->Rot, 1, 1);
n1 = FPoint(0, currItem->Height/2, currItem->xPos(), currItem->yPos(), currItem->Rot, 1, 1);
n1 -= docMinCanvasCoordinate;
d1 = sqrt(pow(n1.x() * Scale - m->x(),2)+pow(n1.y() * Scale - m->y(),2));
if (d1 < Doc->guidesSettings.grabRad)
distance.insert(d1, 7);
n1 = FPoint(currItem->Width/2, 0, currItem->Xpos, currItem->Ypos, currItem->Rot, 1, 1);
n1 = FPoint(currItem->Width/2, 0, currItem->xPos(), currItem->yPos(), currItem->Rot, 1, 1);
n1 -= docMinCanvasCoordinate;
d1 = sqrt(pow(n1.x() * Scale - m->x(),2)+pow(n1.y() * Scale - m->y(),2));
if (d1 < Doc->guidesSettings.grabRad)
7528,6 → 7529,7
 
void ScribusView::Deselect(bool prop)
{
//Doc->selection->clear();
if (SelItem.count() != 0)
{
PageItem* currItem;
7588,7 → 7590,7
 
void ScribusView::EmitValues(PageItem *currItem)
{
emit ItemPos(currItem->Xpos, currItem->Ypos);
emit ItemPos(currItem->xPos(), currItem->yPos());
emit ItemGeom(currItem->Width, currItem->Height);
emit SetAngle(currItem->Rot);
emit SetSizeValue(currItem->Pwidth);
8293,7 → 8295,7
if (SelItem.count() != 0)
{
PageItem *currItem = SelItem.at(0);
SetCCPo(static_cast<int>(currItem->Xpos + currItem->Width/2), static_cast<int>(currItem->Ypos + currItem->Height/2));
SetCCPo(static_cast<int>(currItem->xPos() + currItem->Width/2), static_cast<int>(currItem->yPos() + currItem->Height/2));
}
else
SetCCPo(oldX, oldY);
8755,7 → 8757,7
 
void ScribusView::Transform(PageItem *currItem, QPainter *p)
{
p->translate(static_cast<int>(currItem->Xpos*Scale), static_cast<int>(currItem->Ypos*Scale));
p->translate(static_cast<int>(currItem->xPos()*Scale), static_cast<int>(currItem->yPos()*Scale));
p->scale(Scale, Scale);
p->rotate(currItem->Rot);
}
9037,6 → 9039,7
i = SelItem.at(a);
if ((i->asLine()) && (farbe == "None"))
continue;
i->setLineColor(farbe);
//CB Moved to set**
//if (i->lineColor() != "None")
9798,7 → 9801,7
RefreshItem(currItem);
if (Doc->appMode == modeEdit)
{
horizRuler->setItemPosition(currItem->Xpos, currItem->Width);
horizRuler->setItemPosition(currItem->xPos(), currItem->Width);
if (currItem->lineColor() != "None")
horizRuler->lineCorr = currItem->Pwidth / 2.0;
else
9975,6 → 9978,22
if (SelItem.count() > 1)
undoManager->commit();
}
/*
int docSelectionCount=Doc->selection.count();
if (docSelectionCount==0)
return;
if (docSelectionCount > 1)
undoManager->beginTransaction(Um::SelectionGroup, Um::IGroup,
Um::FlipH, 0, Um::IFlipH);
for (uint a = 0; a < docSelectionCount; ++a)
{
Doc->selection.itemAt(a)->flipImageH();
RefreshItem(Doc->selection.itemAt(a));
}
emit DocChanged();
if (docSelectionCount > 1)
undoManager->commit();
*/
}
 
void ScribusView::FlipImageV()
10907,7 → 10926,7
if (currItem->Rot != 0)
{
QWMatrix sca;
sca.translate(-currItem->Xpos, -currItem->Ypos);
sca.translate(-currItem->xPos(), -currItem->yPos());
sca.rotate(currItem->Rot);
trafo *= sca;
}
10935,7 → 10954,7
if (currItem->Rot != 0)
{
QWMatrix sca;
sca.translate(currItem->Xpos, currItem->Ypos);
sca.translate(currItem->xPos(), currItem->yPos());
pts.map(sca);
}
}
10958,7 → 10977,7
chma.scale(1, -1);
pts.map(chma);
}
uint z = Doc->itemAdd(PageItem::Polygon, PageItem::Unspecified, currItem->Xpos, currItem->Ypos, currItem->Width, currItem->Height, currItem->Pwidth, currItem->lineColor(), currItem->fillColor(), !Mpressed);
uint z = Doc->itemAdd(PageItem::Polygon, PageItem::Unspecified, currItem->xPos(), currItem->yPos(), currItem->Width, currItem->Height, currItem->Pwidth, currItem->lineColor(), currItem->fillColor(), !Mpressed);
bb = Doc->Items->at(z);
bb->setTextFlowsAroundFrame(currItem->textFlowsAroundFrame());
bb->setTextFlowUsesBoundingBox(currItem->textFlowUsesBoundingBox());
11011,8 → 11030,7
if (currItem->imageFlippedV())
textY = currItem->Height - textY+ y - (bb->Height - y);
FPoint npo(textX+x, textY-y, 0.0, 0.0, currItem->Rot, 1.0, 1.0);
bb->Xpos = currItem->Xpos+npo.x();
bb->Ypos = currItem->Ypos+npo.y();
bb->move(npo.x(),npo.y());
}
bb->ContourLine = bb->PoLine.copy();
bb->ClipEdited = true;
11021,7 → 11039,7
}
if ((currItem->asPathText()) && (currItem->PoShow))
{
uint z = Doc->itemAdd(PageItem::PolyLine, PageItem::Unspecified, currItem->Xpos, currItem->Ypos, currItem->Width, currItem->Height, currItem->Pwidth, "None", currItem->lineColor(), !Mpressed);
uint z = Doc->itemAdd(PageItem::PolyLine, PageItem::Unspecified, currItem->xPos(), currItem->yPos(), currItem->Width, currItem->Height, currItem->Pwidth, "None", currItem->lineColor(), !Mpressed);
PageItem *bb = Doc->Items->at(z);
bb->PoLine = currItem->PoLine.copy();
bb->ClipEdited = true;
11072,11 → 11090,11
bb->Groups.clear();
toDel.append(bb->ItemNr);
QWMatrix ma;
ma.translate(bb->Xpos, bb->Ypos);
ma.translate(bb->xPos(), bb->yPos());
ma.rotate(bb->Rot);
bb->PoLine.map(ma);
QWMatrix ma2;
ma2.translate(currItem->Xpos, currItem->Ypos);
ma2.translate(currItem->xPos(), currItem->yPos());
ma2.rotate(currItem->Rot);
ma2 = ma2.invert();
bb->PoLine.map(ma2);
11106,7 → 11124,7
if (currItem->PoLine.point(a).x() > 900000)
{
StartInd = a + 1;
z = Doc->itemAdd(PageItem::Polygon, PageItem::Unspecified, currItem->Xpos, currItem->Ypos, currItem->Width, currItem->Height, currItem->Pwidth, currItem->fillColor(), currItem->lineColor(), !Mpressed);
z = Doc->itemAdd(PageItem::Polygon, PageItem::Unspecified, currItem->xPos(), currItem->yPos(), currItem->Width, currItem->Height, currItem->Pwidth, currItem->fillColor(), currItem->lineColor(), !Mpressed);
bb = Doc->Items->at(z);
bb->PoLine.resize(0);
bb->PoLine.putPoints(0, EndInd - StartInd, currItem->PoLine, StartInd);
/branches/Version13x/Scribus/scribus/pageitem_textframe.cpp
420,7 → 420,7
if (docItem->textFlowsAroundFrame())
{
pp.begin(ScApp->view->viewport());
pp.translate(docItem->Xpos - Mp->xOffset() + Dp->xOffset(), docItem->Ypos - Mp->yOffset() + Dp->yOffset());
pp.translate(docItem->xPos() - Mp->xOffset() + Dp->xOffset(), docItem->yPos() - Mp->yOffset() + Dp->yOffset());
pp.rotate(docItem->Rot);
if (docItem->textFlowUsesBoundingBox())
{
454,7 → 454,7
if (docItem->textFlowsAroundFrame())
{
pp.begin(ScApp->view->viewport());
pp.translate(docItem->Xpos, docItem->Ypos);
pp.translate(docItem->xPos(), docItem->yPos());
pp.rotate(docItem->Rot);
if (docItem->textFlowUsesBoundingBox())
{
491,7 → 491,7
if (docItem->textFlowsAroundFrame())
{
pp.begin(ScApp->view->viewport());
pp.translate(docItem->Xpos, docItem->Ypos);
pp.translate(docItem->xPos(), docItem->yPos());
pp.rotate(docItem->Rot);
if (docItem->textFlowUsesBoundingBox())
{
/branches/Version13x/Scribus/scribus/scribus.cpp
2327,7 → 2327,7
scrActions["insertGlyph"]->setEnabled(true);
if (currItem->asTextFrame())
actionManager->enableUnicodeActions(true);
view->horizRuler->setItemPosition(currItem->Xpos, currItem->Width);
view->horizRuler->setItemPosition(currItem->xPos(), currItem->Width);
if (currItem->lineColor() != "None")
view->horizRuler->lineCorr = currItem->Pwidth / 2.0;
else
4335,8 → 4335,8
currItem2->isEmbedded = true;
currItem2->isAnnotation = false;
currItem2->isBookmark = false;
currItem2->gXpos = currItem2->Xpos - gx;
currItem2->gYpos = currItem2->Ypos - gy;
currItem2->gXpos = currItem2->xPos() - gx;
currItem2->gYpos = currItem2->yPos() - gy;
currItem2->gWidth = gw;
currItem2->gHeight = gh;
currItem2->ItemNr = doc->FrameItems.count();
6568,8 → 6568,8
for (uint b=0; b<view->SelItem.count(); ++b)
{
view->SelItem.at(b)->setLocked(false);
view->SelItem.at(b)->Xpos;
view->SelItem.at(b)->Ypos;
//CB WTF? view->SelItem.at(b)->xPos();
//CB WTF? view->SelItem.at(b)->yPos();
view->MoveItem(DispX, DispY, view->SelItem.at(b));
}
doc->useRaster = savedAlignGrid;
6603,8 → 6603,8
for (uint b=0; b<view->SelItem.count(); ++b)
{
view->SelItem.at(b)->setLocked(false);
view->SelItem.at(b)->Xpos;
view->SelItem.at(b)->Ypos;
//CB WTF? view->SelItem.at(b)->xPos();
//CB WTF? view->SelItem.at(b)->Ypos;
view->MoveItem(dH2, dV2, view->SelItem.at(b), true);
}
dH2 += dH;
6635,28 → 6635,29
// jjsa 23-05-2004 added for centering of rotated objects
if ( currItem->Rot != 0.0 )
{
double y1 = sin(currItem->Rot/180.*M_PI) * currItem->Width;
double x1 = cos(currItem->Rot/180.*M_PI) * currItem->Width;
double y2 = sin((currItem->Rot+90.)/180*M_PI) * currItem->Height;
double x2 = cos((currItem->Rot+90.)/180*M_PI) * currItem->Height;
double mx = currItem->Xpos + ((x1 + x2)/2.0);
double my = currItem->Ypos + ((y1 + y2)/2.0);
double MPI180=1.0/(180.0*M_PI);
double y1 = sin(currItem->Rot*MPI180) * currItem->Width;
double x1 = cos(currItem->Rot*MPI180) * currItem->Width;
double y2 = sin((currItem->Rot+90.0)*MPI180) * currItem->Height;
double x2 = cos((currItem->Rot+90.0)*MPI180) * currItem->Height;
double mx = currItem->xPos() + ((x1 + x2)/2.0);
double my = currItem->yPos() + ((y1 + y2)/2.0);
double viewScale=view->getScale();
if ((qRound((currItem->Xpos + QMAX(x1, x2)) * viewScale) > view->contentsWidth()) ||
(qRound((currItem->Ypos + QMAX(y1, y2)) * viewScale) > view->contentsHeight()))
view->resizeContents(QMAX(qRound((currItem->Xpos + QMAX(x1, x2)) * viewScale), view->contentsWidth()),
QMAX(qRound((currItem->Ypos + QMAX(y1, y2)) * viewScale), view->contentsHeight()));
if ((qRound((currItem->xPos() + QMAX(x1, x2)) * viewScale) > view->contentsWidth()) ||
(qRound((currItem->yPos() + QMAX(y1, y2)) * viewScale) > view->contentsHeight()))
view->resizeContents(QMAX(qRound((currItem->xPos() + QMAX(x1, x2)) * viewScale), view->contentsWidth()),
QMAX(qRound((currItem->yPos() + QMAX(y1, y2)) * viewScale), view->contentsHeight()));
view->SetCCPo(static_cast<int>(mx), static_cast<int>(my));
}
else
{
double viewScale=view->getScale();
if ((qRound((currItem->Xpos + currItem->Width) * viewScale) > view->contentsWidth()) ||
(qRound((currItem->Ypos + currItem->Height) * viewScale) > view->contentsHeight())
if ((qRound((currItem->xPos() + currItem->Width) * viewScale) > view->contentsWidth()) ||
(qRound((currItem->yPos() + currItem->Height) * viewScale) > view->contentsHeight())
)
view->resizeContents(QMAX(qRound((currItem->Xpos + currItem->Width) * viewScale), view->contentsWidth()),
QMAX(qRound((currItem->Ypos + currItem->Height) * viewScale), view->contentsHeight()));
view->SetCCPo(static_cast<int>(currItem->Xpos + currItem->Width/2), static_cast<int>(currItem->Ypos + currItem->Height/2));
view->resizeContents(QMAX(qRound((currItem->xPos() + currItem->Width) * viewScale), view->contentsWidth()),
QMAX(qRound((currItem->yPos() + currItem->Height) * viewScale), view->contentsHeight()));
view->SetCCPo(static_cast<int>(currItem->xPos() + currItem->Width/2), static_cast<int>(currItem->yPos() + currItem->Height/2));
}
}
}
/branches/Version13x/Scribus/scribus/plugins/scriptplugin/cmdobj.cpp
409,7 → 409,7
ScApp->view->SelItem.append(ScApp->doc->Items->at(ii));
PageItem *it = ScApp->doc->Items->at(i);
ScApp->view->ToPathText();
ScApp->view->MoveItem(pageUnitXToDocX(x) - it->Xpos, pageUnitYToDocY(y) - it->Ypos, it);
ScApp->view->MoveItem(pageUnitXToDocX(x) - it->xPos(), pageUnitYToDocY(y) - it->yPos(), it);
if (Name != "")
it->setItemName(QString::fromUtf8(Name));
return PyString_FromString(it->itemName().utf8());
/branches/Version13x/Scribus/scribus/plugins/scriptplugin/cmdgetprop.cpp
159,8 → 159,8
PageItem *i = GetUniqueItem(QString::fromUtf8(Name));
if (!i)
return NULL;
return Py_BuildValue("(ff)", docUnitXToPageX(i->Xpos),
docUnitYToPageY(i->Ypos));
return Py_BuildValue("(ff)", docUnitXToPageX(i->xPos()),
docUnitYToPageY(i->yPos()));
}
 
PyObject *scribus_getsize(PyObject* /* self */, PyObject* args)
/branches/Version13x/Scribus/scribus/plugins/scriptplugin/cmdmani.cpp
105,7 → 105,7
ScApp->view->moveGroup(pageUnitXToDocX(x) - x2, pageUnitYToDocY(y) - y2);
}
else
ScApp->view->MoveItem(pageUnitXToDocX(x) - item->Xpos, pageUnitYToDocY(y) - item->Ypos, item);
ScApp->view->MoveItem(pageUnitXToDocX(x) - item->xPos(), pageUnitYToDocY(y) - item->yPos(), item);
// Now restore the selection. We just have to go through and select
// each and every item, unfortunately.
ScApp->view->Deselect();
/branches/Version13x/Scribus/scribus/plugins/svgimplugin/svgplugin.cpp
618,8 → 618,9
case PageItem::ImageFrame:
{
QWMatrix mm = gc->matrix;
ite->Xpos += mm.dx();
ite->Ypos += mm.dy();
//ite->Xpos += mm.dx();
//ite->Ypos += mm.dy();
ite->move(mm.dx(), mm.dy());
ite->Width = ite->Width * mm.m11();
ite->Height = ite->Height * mm.m22();
ite->Pwidth = ite->Pwidth * ((mm.m11() + mm.m22()) / 2.0);
706,10 → 707,10
gc->GY1 = gra.point(0).y();
gc->GX2 = gra.point(1).x();
gc->GY2 = gra.point(1).y();
ite->GrStartX = gc->GX1 - ite->Xpos+BaseX;
ite->GrStartY = gc->GY1 - ite->Ypos+BaseY;
ite->GrEndX = gc->GX2 - ite->Xpos+BaseX;
ite->GrEndY = gc->GY2 - ite->Ypos+BaseY;
ite->GrStartX = gc->GX1 - ite->xPos()+BaseX;
ite->GrStartY = gc->GY1 - ite->yPos()+BaseY;
ite->GrEndX = gc->GX2 - ite->xPos()+BaseX;
ite->GrEndY = gc->GY2 - ite->yPos()+BaseY;
}
ite->GrType = gc->Gradient;
}
1985,15 → 1986,15
double y1 = parseUnit( tspan.attribute( "y", "0" ) );
double mx = mm.m11() * x1 + mm.m21() * y1 + mm.dx();
double my = mm.m22() * y1 + mm.m12() * x1 + mm.dy();
ite->Xpos = mx;
ite->Ypos = my;
ite->setXPos(mx);
ite->setYPos(my);
}
else
{
double mx = mm.m11() * x + mm.m21() * y + mm.dx();
double my = mm.m22() * y + mm.m12() * x + mm.dy();
ite->Xpos = mx;
ite->Ypos = my;
ite->setXPos(mx);
ite->setYPos(my);
}
if (!tspan.text().isNull())
Text = QString::fromUtf8(tspan.text()).stripWhiteSpace();
2067,7 → 2068,7
ScApp->view->setGroupRect();
ScApp->view->scaleGroup(mm.m11(), mm.m22());
ScApp->view->Deselect();
ite->Ypos -= asce * mm.m22();
ite->move(0.0, -asce * mm.m22());
if( !e.attribute("id").isEmpty() )
ite->setItemName(" "+e.attribute("id"));
ite->setFillTransparency(gc->Transparency);
/branches/Version13x/Scribus/scribus/plugins/svgexplugin/svgexplugin.cpp
337,7 → 337,7
}
else
stroke = "stroke:none;";
trans = "translate("+FToStr(Item->Xpos-Seite->xOffset())+", "+FToStr(Item->Ypos-Seite->yOffset())+")";
trans = "translate("+FToStr(Item->xPos()-Seite->xOffset())+", "+FToStr(Item->yPos()-Seite->yOffset())+")";
if (Item->Rot != 0)
trans += " rotate("+FToStr(Item->Rot)+")";
strokeW = "stroke-width:"+FToStr(Item->Pwidth)+"pt;";
/branches/Version13x/Scribus/scribus/pslib.cpp
987,10 → 987,10
{
FPointArray pb;
pb.resize(0);
pb.addPoint(FPoint(currItem->Xpos-lw, currItem->Ypos-lw));
pb.addPoint(FPoint(currItem->Width+lw*2.0, -lw, currItem->Xpos-lw, currItem->Ypos-lw, currItem->Rot, 1.0, 1.0));
pb.addPoint(FPoint(currItem->Width+lw*2.0, currItem->Height+lw*2.0, currItem->Xpos-lw, currItem->Ypos-lw, currItem->Rot, 1.0, 1.0));
pb.addPoint(FPoint(-lw, currItem->Height+lw*2.0, currItem->Xpos-lw, currItem->Ypos-lw, currItem->Rot, 1.0, 1.0));
pb.addPoint(FPoint(currItem->xPos()-lw, currItem->yPos()-lw));
pb.addPoint(FPoint(currItem->Width+lw*2.0, -lw, currItem->xPos()-lw, currItem->yPos()-lw, currItem->Rot, 1.0, 1.0));
pb.addPoint(FPoint(currItem->Width+lw*2.0, currItem->Height+lw*2.0, currItem->xPos()-lw, currItem->yPos()-lw, currItem->Rot, 1.0, 1.0));
pb.addPoint(FPoint(-lw, currItem->Height+lw*2.0, currItem->xPos()-lw, currItem->yPos()-lw, currItem->Rot, 1.0, 1.0));
for (uint pc = 0; pc < 4; ++pc)
{
minx = QMIN(minx, pb.point(pc).x());
1001,10 → 1001,10
}
else
{
minx = QMIN(minx, currItem->Xpos-lw);
miny = QMIN(miny, currItem->Ypos-lw);
maxx = QMAX(maxx, currItem->Xpos-lw + currItem->Width+lw*2.0);
maxy = QMAX(maxy, currItem->Ypos-lw + currItem->Height+lw*2.0);
minx = QMIN(minx, currItem->xPos()-lw);
miny = QMIN(miny, currItem->yPos()-lw);
maxx = QMAX(maxx, currItem->xPos()-lw + currItem->Width+lw*2.0);
maxy = QMAX(maxy, currItem->yPos()-lw + currItem->Height+lw*2.0);
}
}
gx = minx;
1129,7 → 1129,7
else if (ite->asImageFrame())
{
PS_save();
PS_translate(ite->Xpos - mPage->xOffset(), mPage->height() -(ite->Ypos) - mPage->yOffset());
PS_translate(ite->xPos() - mPage->xOffset(), mPage->height() -(ite->yPos()) - mPage->yOffset());
if (ite->Rot != 0)
PS_rotate(-ite->Rot);
if (ite->fillColor() != "None")
1207,7 → 1207,7
SetFarbe(ite->fillColor(), ite->fillShade(), &h, &s, &v, &k, gcr);
PS_setcmykcolor_fill(h / 255.0, s / 255.0, v / 255.0, k / 255.0);
}
PS_translate(ite->Xpos - mPage->xOffset(), mPage->height() - (ite->Ypos - mPage->yOffset()));
PS_translate(ite->xPos() - mPage->xOffset(), mPage->height() - (ite->yPos() - mPage->yOffset()));
if (ite->Rot != 0)
PS_rotate(-ite->Rot);
if ((ite->fillColor() != "None") || (ite->GrType != 0))
1276,7 → 1276,7
PS_setlinewidth(ite->Pwidth);
PS_setcapjoin(ite->PLineEnd, ite->PLineJoin);
PS_setdash(ite->PLineArt, ite->DashOffset, ite->DashValues);
PS_translate(ite->Xpos - mPage->xOffset(), mPage->height() - (ite->Ypos - mPage->yOffset()));
PS_translate(ite->xPos() - mPage->xOffset(), mPage->height() - (ite->yPos() - mPage->yOffset()));
if (ite->Rot != 0)
PS_rotate(-ite->Rot);
if ((ite->TopLine) || (ite->RightLine) || (ite->BottomLine) || (ite->LeftLine))
1359,7 → 1359,7
PS_setdash(c->PLineArt, c->DashOffset, c->DashValues);
if (!embedded)
{
PS_translate(c->Xpos - a->xOffset(), a->height() - (c->Ypos - a->yOffset()));
PS_translate(c->xPos() - a->xOffset(), a->height() - (c->yPos() - a->yOffset()));
}
if (c->Rot != 0)
PS_rotate(-c->Rot);
1917,7 → 1917,7
PS_setlinewidth(c->Pwidth);
PS_setcapjoin(c->PLineEnd, c->PLineJoin);
PS_setdash(c->PLineArt, c->DashOffset, c->DashValues);
PS_translate(c->Xpos - a->xOffset(), a->height() - (c->Ypos - a->yOffset()));
PS_translate(c->xPos() - a->xOffset(), a->height() - (c->yPos() - a->yOffset()));
if (c->Rot != 0)
PS_rotate(-c->Rot);
if ((c->TopLine) || (c->RightLine) || (c->BottomLine) || (c->LeftLine))
/branches/Version13x/Scribus/scribus/aligndistribute.cpp
458,7 → 458,7
{
double diff=newX-(*alignObjects)[i].x2;
for (uint j = 0; j < (*alignObjects)[i].Objects.count(); ++j)
(*alignObjects)[i].Objects.at(j)->Xpos+=diff;
(*alignObjects)[i].Objects.at(j)->move(diff, 0.0);
}
endAlign();
}
501,7 → 501,7
{
double diff=newX-(*alignObjects)[i].x1;
for (uint j = 0; j < (*alignObjects)[i].Objects.count(); ++j)
(*alignObjects)[i].Objects.at(j)->Xpos+=diff;
(*alignObjects)[i].Objects.at(j)->move(diff, 0.0);
}
endAlign();
}
554,7 → 554,7
{
double diff=newX-(*alignObjects)[i].x1-((*alignObjects)[i].width)/2;
for (uint j = 0; j < (*alignObjects)[i].Objects.count(); ++j)
(*alignObjects)[i].Objects.at(j)->Xpos+=diff;
(*alignObjects)[i].Objects.at(j)->move(diff, 0.0);
}
endAlign();
}
599,7 → 599,7
{
double diff=newX-(*alignObjects)[i].x2;
for (uint j = 0; j < (*alignObjects)[i].Objects.count(); ++j)
(*alignObjects)[i].Objects.at(j)->Xpos+=diff;
(*alignObjects)[i].Objects.at(j)->move(diff, 0.0);
}
endAlign();
}
644,7 → 644,7
{
double diff=newX-(*alignObjects)[i].x1;
for (uint j = 0; j < (*alignObjects)[i].Objects.count(); ++j)
(*alignObjects)[i].Objects.at(j)->Xpos+=diff;
(*alignObjects)[i].Objects.at(j)->move(diff, 0.0);
}
endAlign();
}
687,7 → 687,7
{
double diff=newY-(*alignObjects)[i].y2;
for (uint j = 0; j < (*alignObjects)[i].Objects.count(); ++j)
(*alignObjects)[i].Objects.at(j)->Ypos+=diff;
(*alignObjects)[i].Objects.at(j)->move(0.0, diff);
}
endAlign();
}
730,7 → 730,7
{
double diff=newY-(*alignObjects)[i].y1;
for (uint j = 0; j < (*alignObjects)[i].Objects.count(); ++j)
(*alignObjects)[i].Objects.at(j)->Ypos+=diff;
(*alignObjects)[i].Objects.at(j)->move(0.0, diff);
}
endAlign();
}
784,7 → 784,7
{
double diff=newY-(*alignObjects)[i].y1-((*alignObjects)[i].height)/2;
for (uint j = 0; j < (*alignObjects)[i].Objects.count(); ++j)
(*alignObjects)[i].Objects.at(j)->Ypos+=diff;
(*alignObjects)[i].Objects.at(j)->move(0.0, diff);
}
endAlign();
}
830,7 → 830,7
{
double diff=newY-(*alignObjects)[i].y2;
for (uint j = 0; j < (*alignObjects)[i].Objects.count(); ++j)
(*alignObjects)[i].Objects.at(j)->Ypos+=diff;
(*alignObjects)[i].Objects.at(j)->move(0.0, diff);
}
endAlign();
}
875,7 → 875,7
{
double diff=newY-(*alignObjects)[i].y1;
for (uint j = 0; j < (*alignObjects)[i].Objects.count(); ++j)
(*alignObjects)[i].Objects.at(j)->Ypos+=diff;
(*alignObjects)[i].Objects.at(j)->move(0.0, diff);
}
endAlign();
}
913,7 → 913,7
{
double diff=minX + i*separation-(*alignObjects)[it.data()].x1;
for (uint j = 0; j < (*alignObjects)[it.data()].Objects.count(); ++j)
(*alignObjects)[it.data()].Objects.at(j)->Xpos+=diff;
(*alignObjects)[it.data()].Objects.at(j)->move(diff, 0.0);
i++;
}
endAlign();
951,7 → 951,7
{
double diff=minX + i*separation-(*alignObjects)[it.data()].x1-((*alignObjects)[it.data()].width)/2;
for (uint j = 0; j < (*alignObjects)[it.data()].Objects.count(); ++j)
(*alignObjects)[it.data()].Objects.at(j)->Xpos+=diff;
(*alignObjects)[it.data()].Objects.at(j)->move(diff, 0.0);
i++;
}
endAlign();
989,7 → 989,7
{
double diff=minX + i*separation-(*alignObjects)[it.data()].x2;
for (uint j = 0; j < (*alignObjects)[it.data()].Objects.count(); ++j)
(*alignObjects)[it.data()].Objects.at(j)->Xpos+=diff;
(*alignObjects)[it.data()].Objects.at(j)->move(diff, 0.0);
i++;
}
endAlign();
1044,7 → 1044,7
 
double diff=currX-(*alignObjects)[it.data()].x1;
for (uint j = 0; j < (*alignObjects)[it.data()].Objects.count(); ++j)
(*alignObjects)[it.data()].Objects.at(j)->Xpos+=diff;
(*alignObjects)[it.data()].Objects.at(j)->move(diff, 0.0);
currX+=(*alignObjects)[it.data()].width;
}
endAlign();
1089,7 → 1089,7
{
double diff=minY + i*separation-(*alignObjects)[it.data()].y2;
for (uint j = 0; j < (*alignObjects)[it.data()].Objects.count(); ++j)
(*alignObjects)[it.data()].Objects.at(j)->Ypos+=diff;
(*alignObjects)[it.data()].Objects.at(j)->move(0.0, diff);
i++;
}
endAlign();
1127,7 → 1127,7
{
double diff=minY + i*separation-(*alignObjects)[it.data()].y1-((*alignObjects)[it.data()].height)/2;
for (uint j = 0; j < (*alignObjects)[it.data()].Objects.count(); ++j)
(*alignObjects)[it.data()].Objects.at(j)->Ypos+=diff;
(*alignObjects)[it.data()].Objects.at(j)->move(0.0, diff);
i++;
}
endAlign();
1165,7 → 1165,7
{
double diff=minY + i*separation-(*alignObjects)[it.data()].y1;
for (uint j = 0; j < (*alignObjects)[it.data()].Objects.count(); ++j)
(*alignObjects)[it.data()].Objects.at(j)->Ypos+=diff;
(*alignObjects)[it.data()].Objects.at(j)->move(0.0,diff);
i++;
}
endAlign();
1220,7 → 1220,7
 
double diff=currY-(*alignObjects)[it.data()].y1;
for (uint j = 0; j < (*alignObjects)[it.data()].Objects.count(); ++j)
(*alignObjects)[it.data()].Objects.at(j)->Ypos+=diff;
(*alignObjects)[it.data()].Objects.at(j)->move(0.0,diff);
currY+=(*alignObjects)[it.data()].height;
}
endAlign();