Subversion Repositories Scribus

Compare Revisions

Regard whitespace Rev 19994 → Rev 19995

/trunk/Scribus/scribus/canvas.cpp
628,13 → 628,22
 
void Canvas::clearBuffers()
{
m_buffer = /*QImage()*/QPixmap();
m_buffer = QPixmap();
m_bufferRect = QRect();
m_selectionBuffer = QPixmap();
m_selectionRect = QRect();
}
 
void Canvas::setScale(double scale)
{
if (m_viewMode.scale == scale)
return;
m_viewMode.scale = scale;
clearBuffers();
update();
}
 
 
bool Canvas::adjustBuffer()
{
bool ret = false;
/trunk/Scribus/scribus/canvas.h
149,7 → 149,7
void setRenderModeUseBuffer(bool use) { m_renderMode = (use ? RENDER_BUFFERED : RENDER_NORMAL) ; }
 
double scale() const { return m_viewMode.scale; }
void setScale(double scale) { if (m_viewMode.scale != scale) { m_viewMode.scale = scale; clearBuffers(); update(); } }
void setScale(double scale);
QPoint canvasToLocal(FPoint p) const;
QPoint canvasToGlobal(FPoint p) const;
QPoint canvasToLocal(QPointF p) const;
265,7 → 265,7
CanvasViewMode m_viewMode;
RenderMode m_renderMode;
/*QImage*/QPixmap m_buffer;
QPixmap m_buffer;
QRect m_bufferRect;
QPixmap m_selectionBuffer;
QRect m_selectionRect;
/trunk/Scribus/scribus/plugins/picbrowser/picturebrowser.cpp
27,8 → 27,8
 
PictureBrowser::PictureBrowser ( ScribusDoc* doc, QWidget *parent ) :
QDialog ( parent ),
pImages(0),
pModel(0)
pModel(0),
pImages(0)
{
setupUi ( this );
 
/trunk/Scribus/scribus/scribusview.cpp
2315,7 → 2315,6
int w = qRound(qMin(visibleWidth() / m_canvas->scale(), Doc->currentPage()->width()));
int h = qRound(qMin(visibleHeight() / m_canvas->scale(), Doc->currentPage()->height()));
rememberOldZoomLocation(w / 2 + x,h / 2 + y);
//zoom(oldX, oldY, zoomSpinBox->value() / 100.0 * Prefs->displayPrefs.displayScale, false);
zoom(oldX, oldY, m_ScMW->zoomSpinBox->value() / 100.0 * Prefs->displayPrefs.displayScale, false);
setFocus();
}
4316,7 → 4315,6
 
void ScribusView::zoom(int canvasX, int canvasY, double scale, bool preservePoint)
{
QPoint canvasPoint;
QPoint globalPoint = m_canvas->canvasToGlobal(QPointF(canvasX, canvasY));
double newScale = (scale > (Prefs->opToolPrefs.magMax / 100) * Prefs->displayPrefs.displayScale) ? ((Prefs->opToolPrefs.magMax / 100) * Prefs->displayPrefs.displayScale) : scale;
undoManager->setUndoEnabled(false);
4326,13 → 4324,11
int nw = qMax(qRound((Doc->maxCanvasCoordinate.x() - Doc->minCanvasCoordinate.x()) * m_canvas->scale()), visibleWidth());
int nh = qMax(qRound((Doc->maxCanvasCoordinate.y() - Doc->minCanvasCoordinate.y()) * m_canvas->scale()), visibleHeight());
resizeContents(nw, nh); // FIXME : should be avoided here, cause an unnecessary paintEvent despite updates disabled
QPoint canvasPoint;
if (preservePoint)
canvasPoint = viewport()->mapFromGlobal(globalPoint);
else
{
QSize viewsize = viewport()->size();
canvasPoint = QPoint(viewsize.width() / 2, viewsize.height() / 2);
}
canvasPoint = QPoint(viewport()->width() / 2, viewport()->height() / 2);
setContentsPos(localPoint.x() - canvasPoint.x(), localPoint.y() - canvasPoint.y());
updatesOn(true);
undoManager->setUndoEnabled(true);