38 void gridSize(QPointF *offset, QSizeF *spacing)
const override
138 foreach (
KoShape *shape,
d->canvas->shapeManager()->shapes()) {
142 d->canvas->shapeManager()->paint(painter);
147 if (documentRect.width() == 0.0f || documentRect.height() == 0.0f)
152 QRectF paintBox = converter.
viewToDocument(QRectF(QPointF(), painterRect.size()));
156 qreal zoomW = paintBox.width() / documentRect.width();
157 qreal zoomH = paintBox.height() / documentRect.height();
158 qreal zoom = qMin(zoomW, zoomH);
166 painter.setPen(QPen(Qt::NoPen));
167 painter.setBrush(Qt::NoBrush);
168 painter.setRenderHint(QPainter::Antialiasing);
169 painter.setClipRect(painterRect.adjusted(-1,-1,1,1));
174 QPointF offset = QRectF(painterRect).center() - zoomedBound.center();
176 painter.translate(offset.x(), offset.y());
190 QPainter painter(&image);
198 foreach (
KoShape *shape,
d->canvas->shapeManager()->shapes()) {
209 bound = bound.united(shapeRect);
221 d->
canvas->setUpdateFunction(function);
virtual KoShapeManager * shapeManager() const =0
The KoSelectedShapesProxy class is a special interface of KoCanvasBase to have a stable connection to...
@ AddWithoutRepaint
Avoids each shapes 'update()' to be called for faster addition when its possible.
void setShapes(const QList< KoShape * > &shapes)
QRectF contentRect() const
Returns the bounding rect of the shapes to paint.
KoShapeManager * internalShapeManager() const
internalShapeManager KoShapePainter has an internal shape manager that is used to paint the shapes.
void paint(QPainter &painter)
void setUpdateFunction(std::function< void(const QRectF &)> function)
QScopedPointer< Private > d
virtual QRectF boundingRect() const
Get the bounding box of the shape.
bool isVisible(bool recursive=true) const
virtual void waitUntilReady(bool asynchronous=true) const
@ Point
Postscript point, 1/72th of an Inco.
virtual void setZoom(qreal zoom)
virtual QPointF viewToDocument(const QPointF &viewPoint) const
virtual QPointF documentToView(const QPointF &documentPoint) const
QWidget * canvasWidget() override
KoSelectedShapesProxy * selectedShapesProxy() const override
selectedShapesProxy() is a special interface for keeping a persistent connections to selectionChanged...
const KoViewConverter * viewConverter() const override
void gridSize(QPointF *offset, QSizeF *spacing) const override
bool snapToGrid() const override
void setCursor(const QCursor &) override
void addCommand(KUndo2Command *) override
void setUpdateFunction(std::function< void(const QRectF &)> function)
QScopedPointer< KoShapeManager > m_shapeManager
const QWidget * canvasWidget() const override
KoToolProxy * toolProxy() const override
KoUnit unit() const override
QScopedPointer< KoSelectedShapesProxySimple > m_selectedShapesProxy
void updateCanvas(const QRectF &rect) override
std::function< void(const QRectF &) m_updateFunc)
KoViewConverter * viewConverter() override
KoShapeManager * shapeManager() const override
typedef void(QOPENGLF_APIENTRYP PFNGLINVALIDATEBUFFERDATAPROC)(GLuint buffer)