Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 16503 → Rev 16504

/trunk/Scribus/scribus/pageitempreview.cpp
47,7 → 47,7
{
QMutexLocker locker(&m_mutex);
m_image = m_pageitem->DrawObj_toImage();
m_image = m_pageitem->DrawObj_toImage(100);
m_completed = true;
}
/trunk/Scribus/scribus/scribusdoc.cpp
3973,7 → 3973,7
loadPict(ite->Pfile, ite, true, false);
}
PageItem *ite = pa.items.at(0);
docPatterns[patterns[c]].pattern = ite->DrawObj_toImage(pa.items);
docPatterns[patterns[c]].pattern = ite->DrawObj_toImage(pa.items, 1.0);
}
}
 
5349,7 → 5349,7
}
}
currItem = Items->at(0);
docPatterns[currentEditedSymbol].pattern = currItem->DrawObj_toImage();
docPatterns[currentEditedSymbol].pattern = currItem->DrawObj_toImage(qMax(currItem->gWidth, currItem->gHeight));
docPatterns[currentEditedSymbol].width = currItem->gWidth;
docPatterns[currentEditedSymbol].height = currItem->gHeight;
if (m_ScMW->patternsDependingOnThis.count() > 1)
5359,7 → 5359,7
Items = &docPatterns[m_ScMW->patternsDependingOnThis[a]].items;
renumberItemsInListOrder();
currItem = Items->at(0);
docPatterns[m_ScMW->patternsDependingOnThis[a]].pattern = currItem->DrawObj_toImage();
docPatterns[m_ScMW->patternsDependingOnThis[a]].pattern = currItem->DrawObj_toImage(qMax(currItem->gWidth, currItem->gHeight));
}
}
if (masterPageMode())
7542,7 → 7542,7
allItems.clear();
}
PageItem *ite = pa.items.at(0);
docPatterns[patterns[c]].pattern = ite->DrawObj_toImage(pa.items);
docPatterns[patterns[c]].pattern = ite->DrawObj_toImage(pa.items, 1.0);
}
regionsChanged()->update(QRectF());
changed();
7683,7 → 7683,7
}
allItems.clear();
PageItem *ite = pa.items.at(0);
docPatterns[patterns[c]].pattern = ite->DrawObj_toImage(pa.items);
docPatterns[patterns[c]].pattern = ite->DrawObj_toImage(pa.items, 1.0);
}
}
regionsChanged()->update(QRectF());
7892,7 → 7892,7
allItems.clear();
}
PageItem *ite = pa.items.at(0);
docPatterns[patterns[c]].pattern = ite->DrawObj_toImage(pa.items);
docPatterns[patterns[c]].pattern = ite->DrawObj_toImage(pa.items, 1.0);
}
regionsChanged()->update(QRectF());
changed();
7980,7 → 7980,7
allItems.clear();
}
PageItem *ite = pa.items.at(0);
docPatterns[patterns[c]].pattern = ite->DrawObj_toImage(pa.items);
docPatterns[patterns[c]].pattern = ite->DrawObj_toImage(pa.items, 1.0);
}
regionsChanged()->update(QRectF());
changed();
/trunk/Scribus/scribus/pageitem.h
291,8 → 291,8
virtual void DrawObj_Post(ScPainter *p);
virtual void DrawObj_Decoration(ScPainter *p);
virtual void DrawObj_Item(ScPainter *p, QRectF e) = 0;
QImage DrawObj_toImage();
QImage DrawObj_toImage(QList<PageItem*> &emG);
QImage DrawObj_toImage(double maxSize);
QImage DrawObj_toImage(QList<PageItem*> &emG, double scaling);
virtual void applicableActions(QStringList& actionList) = 0;
virtual QString infoDescription();
/trunk/Scribus/scribus/pageitem.cpp
1975,7 → 1975,7
p->newPath();
}
 
QImage PageItem::DrawObj_toImage()
QImage PageItem::DrawObj_toImage(double maxSize)
{
QList<PageItem*> emG;
emG.clear();
1993,16 → 1993,17
gYpos = yPos() - miny;
gWidth = maxx - minx;
gHeight = maxy - miny;
double sc = maxSize / qMax(gWidth, gHeight);
emG.append(this);
return DrawObj_toImage(emG);
return DrawObj_toImage(emG, sc);
}
 
QImage PageItem::DrawObj_toImage(QList<PageItem*> &emG)
QImage PageItem::DrawObj_toImage(QList<PageItem*> &emG, double scaling)
{
QImage retImg = QImage(qRound(gWidth), qRound(gHeight), QImage::Format_ARGB32_Premultiplied);
QImage retImg = QImage(qRound(gWidth * scaling), qRound(gHeight * scaling), QImage::Format_ARGB32_Premultiplied);
retImg.fill( qRgba(0, 0, 0, 0) );
ScPainter *painter = new ScPainter(&retImg, retImg.width(), retImg.height(), 1, 0);
painter->setZoomFactor(qMax(qRound(gWidth) / gWidth, qRound(gHeight) / gHeight));
painter->setZoomFactor(scaling);
for (int em = 0; em < emG.count(); ++em)
{
PageItem* embedded = emG.at(em);
/trunk/Scribus/scribus/ui/paintmanager.cpp
49,6 → 49,7
#include "sccolor.h"
#include "sccolorengine.h"
#include "scconfig.h"
#include "sclimits.h"
#include "sclistboxpixmap.h"
#include "scclocale.h"
#include "scpainter.h"
524,7 → 525,7
ite->setGradientMask(newName);
}
PageItem *ite = pa.items.at(0);
dialogPatterns[patterns[c]].pattern = ite->DrawObj_toImage(pa.items);
dialogPatterns[patterns[c]].pattern = ite->DrawObj_toImage(pa.items, 1.0);
}
QTreeWidgetItem *lg = updateGradientList(dia->name());
if (lg != 0)
1319,7 → 1320,17
ScPattern pat = ScPattern();
pat.setDoc(m_doc);
PageItem* currItem = m_doc->Items->at(ac);
pat.pattern = currItem->DrawObj_toImage();
double minx = std::numeric_limits<double>::max();
double miny = std::numeric_limits<double>::max();
double maxx = -std::numeric_limits<double>::max();
double maxy = -std::numeric_limits<double>::max();
double x1, x2, y1, y2;
currItem->getVisualBoundingRect(&x1, &y1, &x2, &y2);
minx = qMin(minx, x1);
miny = qMin(miny, y1);
maxx = qMax(maxx, x2);
maxy = qMax(maxy, y2);
pat.pattern = currItem->DrawObj_toImage(qMax(maxx - minx, maxy - miny));
pat.width = currItem->gWidth;
pat.height = currItem->gHeight;
for (uint as = ac; as < ae; ++as)
1509,7 → 1520,7
}
}
PageItem *ite = pa.items.at(0);
dialogPatterns[patterns[c]].pattern = ite->DrawObj_toImage(pa.items);
dialogPatterns[patterns[c]].pattern = ite->DrawObj_toImage(pa.items, 1.0);
}
m_doc->PageColors = colorListBack;
}
/trunk/Scribus/scribus/scribus.cpp
9970,7 → 9970,17
currItem = itemSelection.itemAt(0);
ScPattern pat = ScPattern();
pat.setDoc(doc);
pat.pattern = currItem->DrawObj_toImage();
double minx = std::numeric_limits<double>::max();
double miny = std::numeric_limits<double>::max();
double maxx = -std::numeric_limits<double>::max();
double maxy = -std::numeric_limits<double>::max();
double x1, x2, y1, y2;
currItem->getVisualBoundingRect(&x1, &y1, &x2, &y2);
minx = qMin(minx, x1);
miny = qMin(miny, y1);
maxx = qMax(maxx, x2);
maxy = qMax(maxy, y2);
pat.pattern = currItem->DrawObj_toImage(qMax(maxx - minx, maxy - miny));
pat.width = currItem->gWidth;
pat.height = currItem->gHeight;
pat.items.append(currItem);
/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
3057,7 → 3057,7
if (itemCount2 > itemCount1)
{
PageItem* currItem = doc->Items->at(itemCount1), *newItem;
pat.pattern = currItem->DrawObj_toImage();
pat.pattern = currItem->DrawObj_toImage(qMax(pat.width, pat.height));
pat.pattern = pat.pattern.copy(-pat.xoffset, -pat.yoffset, pat.width, pat.height);
for (uint as = itemCount1; as < itemCount2; ++as)
{
/trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
2146,7 → 2146,7
if (itemCount2 > itemCount1)
{
PageItem* currItem = doc->Items->at(itemCount1), *newItem;
pat.pattern = currItem->DrawObj_toImage();
pat.pattern = currItem->DrawObj_toImage(qMax(pat.width, pat.height));
pat.pattern = pat.pattern.copy(-pat.xoffset, -pat.yoffset, pat.width, pat.height);
for (uint as = itemCount1; as < itemCount2; ++as)
{
/trunk/Scribus/scribus/plugins/import/cvg/importcvg.cpp
100,9 → 100,7
tmpSel->setGroupRect();
double xs = tmpSel->width();
double ys = tmpSel->height();
double sc = 500.0 / qMax(xs, ys);
m_Doc->scaleGroup(sc, sc, true, tmpSel);
tmpImage = Elements.at(0)->DrawObj_toImage();
tmpImage = Elements.at(0)->DrawObj_toImage(500);
tmpImage.setText("XSize", QString("%1").arg(xs));
tmpImage.setText("YSize", QString("%1").arg(ys));
}
/trunk/Scribus/scribus/plugins/import/pct/importpct.cpp
103,9 → 103,7
tmpSel->setGroupRect();
double xs = tmpSel->width();
double ys = tmpSel->height();
double sc = 500.0 / qMax(xs, ys);
m_Doc->scaleGroup(sc, sc, true, tmpSel);
tmpImage = Elements.at(0)->DrawObj_toImage();
tmpImage = Elements.at(0)->DrawObj_toImage(500);
tmpImage.setText("XSize", QString("%1").arg(xs));
tmpImage.setText("YSize", QString("%1").arg(ys));
}
/trunk/Scribus/scribus/plugins/import/ai/importai.cpp
182,9 → 182,7
tmpSel->setGroupRect();
double xs = tmpSel->width();
double ys = tmpSel->height();
double sc = 500.0 / qMax(xs, ys);
m_Doc->scaleGroup(sc, sc, true, tmpSel);
tmpImage = Elements.at(0)->DrawObj_toImage();
tmpImage = Elements.at(0)->DrawObj_toImage(500);
tmpImage.setText("XSize", QString("%1").arg(xs));
tmpImage.setText("YSize", QString("%1").arg(ys));
m_Doc->m_Selection->delaySignalsOff();
2496,7 → 2494,7
currItem->setItemName(currentPatternDefName);
currItem->AutoName = false;
m_Doc->DoDrawing = true;
QImage tmpImg = currItem->DrawObj_toImage();
QImage tmpImg = currItem->DrawObj_toImage(qMax(qRound(patternX2 - patternX1), qRound(patternY2 - patternY1)));
if (!tmpImg.isNull())
{
QImage retImg = QImage(qRound(patternX2 - patternX1), qRound(patternY2 - patternY1), QImage::Format_ARGB32_Premultiplied);
2644,7 → 2642,7
currItem->setItemName(currentPatternDefName);
currItem->AutoName = false;
m_Doc->DoDrawing = true;
pat.pattern = currItem->DrawObj_toImage();
pat.pattern = currItem->DrawObj_toImage(qMax(tmpSel->width(), tmpSel->height()));
if (!pat.pattern.isNull())
{
pat.width = currItem->gWidth;
/trunk/Scribus/scribus/plugins/import/wmf/wmfimport.cpp
346,9 → 346,7
m_tmpSel->setGroupRect();
double xs = m_tmpSel->width();
double ys = m_tmpSel->height();
double sc = 500.0 / qMax(xs, ys);
m_Doc->scaleGroup(sc, sc, true, m_tmpSel);
tmpImage = Elements.at(0)->DrawObj_toImage();
tmpImage = Elements.at(0)->DrawObj_toImage(500);
tmpImage.setText("XSize", QString("%1").arg(xs));
tmpImage.setText("YSize", QString("%1").arg(ys));
m_Doc->m_Selection->delaySignalsOff();
/trunk/Scribus/scribus/plugins/import/xar/importxar.cpp
3513,7 → 3513,7
if (gg.isBrush)
{
m_Doc->DoDrawing = true;
QImage tmpImg = groupItem->DrawObj_toImage();
QImage tmpImg = groupItem->DrawObj_toImage(qMax(groupItem->width(), groupItem->height()));
ScPattern pat = ScPattern();
pat.setDoc(m_Doc);
pat.width = groupItem->width();
/trunk/Scribus/scribus/plugins/import/oodraw/oodrawimp.cpp
369,9 → 369,7
tmpSel->setGroupRect();
double xs = tmpSel->width();
double ys = tmpSel->height();
double sc = 500.0 / qMax(xs, ys);
m_Doc->scaleGroup(sc, sc, true, tmpSel);
tmpImage = Elements.at(0)->DrawObj_toImage();
tmpImage = Elements.at(0)->DrawObj_toImage(500);
tmpImage.setText("XSize", QString("%1").arg(xs));
tmpImage.setText("YSize", QString("%1").arg(ys));
m_Doc->m_Selection->delaySignalsOff();
/trunk/Scribus/scribus/plugins/import/sml/importsml.cpp
100,9 → 100,7
tmpSel->setGroupRect();
double xs = tmpSel->width();
double ys = tmpSel->height();
double sc = 500.0 / qMax(xs, ys);
m_Doc->scaleGroup(sc, sc, true, tmpSel);
tmpImage = Elements.at(0)->DrawObj_toImage();
tmpImage = Elements.at(0)->DrawObj_toImage(500);
tmpImage.setText("XSize", QString("%1").arg(xs));
tmpImage.setText("YSize", QString("%1").arg(ys));
}
/trunk/Scribus/scribus/plugins/import/drw/importdrw.cpp
116,9 → 116,7
tmpSel->setGroupRect();
double xs = tmpSel->width();
double ys = tmpSel->height();
double sc = 500.0 / qMax(xs, ys);
m_Doc->scaleGroup(sc, sc, true, tmpSel);
tmpImage = Elements.at(0)->DrawObj_toImage();
tmpImage = Elements.at(0)->DrawObj_toImage(500);
tmpImage.setText("XSize", QString("%1").arg(xs));
tmpImage.setText("YSize", QString("%1").arg(ys));
}
/trunk/Scribus/scribus/plugins/import/xfig/importxfig.cpp
167,9 → 167,7
tmpSel->setGroupRect();
double xs = tmpSel->width();
double ys = tmpSel->height();
double sc = 500.0 / qMax(xs, ys);
m_Doc->scaleGroup(sc, sc, true, tmpSel);
tmpImage = Elements.at(0)->DrawObj_toImage();
tmpImage = Elements.at(0)->DrawObj_toImage(500);
tmpImage.setText("XSize", QString("%1").arg(xs));
tmpImage.setText("YSize", QString("%1").arg(ys));
}
/trunk/Scribus/scribus/plugins/import/wpg/importwpg.cpp
464,9 → 464,7
tmpSel->setGroupRect();
double xs = tmpSel->width();
double ys = tmpSel->height();
double sc = 500.0 / qMax(xs, ys);
m_Doc->scaleGroup(sc, sc, true, tmpSel);
tmpImage = Elements.at(0)->DrawObj_toImage();
tmpImage = Elements.at(0)->DrawObj_toImage(500);
tmpImage.setText("XSize", QString("%1").arg(xs));
tmpImage.setText("YSize", QString("%1").arg(ys));
}
/trunk/Scribus/scribus/plugins/import/svg/svgplugin.cpp
304,9 → 304,7
tmpSel->setGroupRect();
double xs = tmpSel->width();
double ys = tmpSel->height();
double sc = 500.0 / qMax(xs, ys);
m_Doc->scaleGroup(sc, sc, true, tmpSel);
tmpImage = Elements.at(0)->DrawObj_toImage();
tmpImage = Elements.at(0)->DrawObj_toImage(500);
tmpImage.setText("XSize", QString("%1").arg(xs));
tmpImage.setText("YSize", QString("%1").arg(ys));
m_Doc->m_Selection->delaySignalsOff();
2742,7 → 2740,7
pat.setDoc(m_Doc);
PageItem* currItem = GElements.at(0);
m_Doc->DoDrawing = true;
pat.pattern = currItem->DrawObj_toImage();
pat.pattern = currItem->DrawObj_toImage(qMax(wpat, hpat));
double xOrg = 0.0;
double yOrg = 0.0;
if (inGroupXOrigin < 0.0)
/trunk/Scribus/scribus/plugins/import/shape/importshape.cpp
102,9 → 102,7
tmpSel->setGroupRect();
double xs = tmpSel->width();
double ys = tmpSel->height();
double sc = 500.0 / qMax(xs, ys);
m_Doc->scaleGroup(sc, sc, true, tmpSel);
tmpImage = Elements.at(0)->DrawObj_toImage();
tmpImage = Elements.at(0)->DrawObj_toImage(500);
tmpImage.setText("XSize", QString("%1").arg(xs));
tmpImage.setText("YSize", QString("%1").arg(ys));
}
/trunk/Scribus/scribus/plugins/import/cgm/importcgm.cpp
104,9 → 104,7
tmpSel->setGroupRect();
double xs = tmpSel->width();
double ys = tmpSel->height();
double sc = 500.0 / qMax(xs, ys);
m_Doc->scaleGroup(sc, sc, true, tmpSel);
tmpImage = Elements.at(0)->DrawObj_toImage();
tmpImage = Elements.at(0)->DrawObj_toImage(500);
tmpImage.setText("XSize", QString("%1").arg(xs));
tmpImage.setText("YSize", QString("%1").arg(ys));
}
/trunk/Scribus/scribus/scpreview.cpp
68,7 → 68,7
double ys = tmpSel->height();
// double sc = 60.0 / qMax(xs, ys);
// m_Doc->scaleGroup(sc, sc, true, tmpSel);
QImage tmpImage = Elements.at(0)->DrawObj_toImage();
QImage tmpImage = Elements.at(0)->DrawObj_toImage(128);
tmpImage.setText("XSize", QString("%1").arg(xs));
tmpImage.setText("YSize", QString("%1").arg(ys));
m_Doc->m_Selection->delaySignalsOff();