Пример #1
0
/**
 * You should use this function instead of calling scale() directly
 * to keep track of the zoom factor.
 * @param zoom new zoom factor
 */
void CanvasView::setZoom(int zoom)
{
	Q_ASSERT(zoom>0);
	_zoom = zoom;
	QMatrix nm(1,0,0,1, matrix().dx(), matrix().dy());
	nm.scale(_zoom/100.0, _zoom/100.0);
	nm.rotate(_rotate);
	setMatrix(nm);
	emit viewTransformed(_zoom, _rotate);
}
Пример #2
0
/**
 * You should use this function instead of calling scale() directly
 * to keep track of the zoom factor.
 * @param zoom new zoom factor
 */
void EditorView::setZoom(int zoom)
{
    Q_ASSERT(zoom>0);
    zoom_ = zoom;
    QMatrix nm(1,0,0,1, matrix().dx(), matrix().dy());
    nm.scale(zoom_/100.0, zoom_/100.0);
    nm.rotate(rotate_);
    setMatrix(nm);
    emit viewTransformed(zoom_, rotate_);
}
Пример #3
0
/**
 * You should use this function instead of calling scale() directly
 * to keep track of the zoom factor.
 * @param zoom new zoom factor
 */
void CanvasView::setZoom(qreal zoom)
{
	if(zoom<=0)
		return;

	_zoom = zoom;
	QMatrix nm(1,0,0,1, matrix().dx(), matrix().dy());
	nm.scale(_zoom/100.0, _zoom/100.0);
	nm.rotate(_rotate);
	setMatrix(nm);
	emit viewTransformed(_zoom, _rotate);
	viewRectChanged();
}