Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 19995 → Rev 19994

/trunk/Scribus/scribus/plugins/picbrowser/picturebrowser.cpp
27,8 → 27,8
 
PictureBrowser::PictureBrowser ( ScribusDoc* doc, QWidget *parent ) :
QDialog ( parent ),
pModel(0),
pImages(0)
pImages(0),
pModel(0)
{
setupUi ( this );
 
/trunk/Scribus/scribus/scribusview.cpp
2315,6 → 2315,7
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();
}
4315,8 → 4316,9
 
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;
double newScale = (scale > (Prefs->opToolPrefs.magMax / 100) * Prefs->displayPrefs.displayScale) ? ((Prefs->opToolPrefs.magMax / 100) * Prefs->displayPrefs.displayScale) : scale;
undoManager->setUndoEnabled(false);
updatesOn(false);
setScale(newScale);
4324,11 → 4326,13
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
canvasPoint = QPoint(viewport()->width() / 2, viewport()->height() / 2);
{
QSize viewsize = viewport()->size();
canvasPoint = QPoint(viewsize.width() / 2, viewsize.height() / 2);
}
setContentsPos(localPoint.x() - canvasPoint.x(), localPoint.y() - canvasPoint.y());
updatesOn(true);
undoManager->setUndoEnabled(true);
/trunk/Scribus/scribus/canvas.cpp
628,22 → 628,13
 
void Canvas::clearBuffers()
{
m_buffer = QPixmap();
m_buffer = /*QImage()*/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);
void setScale(double scale) { if (m_viewMode.scale != scale) { m_viewMode.scale = scale; clearBuffers(); update(); } }
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;
QPixmap m_buffer;
/*QImage*/QPixmap m_buffer;
QRect m_bufferRect;
QPixmap m_selectionBuffer;
QRect m_selectionRect;