Commit 09e08d65 authored by Inge Wallin's avatar Inge Wallin

Rename KoShapeBorderModel.cpp -> KoShapeStrokeModel.cpp

As written in the review request:

There are 2 reasons for this change:

 1. It increases the way the name describes what it actually is
    for. There are many places in the code that looks like:
      KoShapeBorderModel *stroke = ...
    so naming it "...Stroke..." is both closer to the odf tags and
    also to the rest of the code.
 2. It reduces the confusion between KoShapeBorderModel and KoBorder
    which don't have anything to do with each other.

REVIEW: 104405
parent baf07c69
......@@ -76,7 +76,7 @@ set(flake_SRCS
KoLoadingShapeUpdater.cpp
KoPathShapeLoader.cpp
ShapeDeleter_p.cpp
KoShapeBorderModel.cpp
KoShapeStrokeModel.cpp
KoShapeBorderFactoryBase.cpp
KoShapeBorderRegistry.cpp
KoLineBorder.cpp
......@@ -129,7 +129,6 @@ set(flake_SRCS
commands/KoShapeGroupCommand.cpp
commands/KoShapeAlignCommand.cpp
commands/KoShapeBackgroundCommand.cpp
commands/KoShapeBorderCommand.cpp
commands/KoShapeCreateCommand.cpp
commands/KoShapeDeleteCommand.cpp
commands/KoShapeDistributeCommand.cpp
......@@ -137,6 +136,7 @@ set(flake_SRCS
commands/KoShapeMoveCommand.cpp
commands/KoShapeShearCommand.cpp
commands/KoShapeSizeCommand.cpp
commands/KoShapeStrokeCommand.cpp
commands/KoShapeUngroupCommand.cpp
commands/KoShapeReorderCommand.cpp
commands/KoShapeKeepAspectRatioCommand.cpp
......@@ -279,7 +279,7 @@ install(
KoRTree.h
KoSelection.h
KoShape.h
KoShapeBorderModel.h
KoShapeStrokeModel.h
KoToolSelection.h
KoShapeContainer.h
KoShapeContainerModel.h
......@@ -330,7 +330,7 @@ install(
commands/KoPathSeparateCommand.h
commands/KoShapeAlignCommand.h
commands/KoShapeBackgroundCommand.h
commands/KoShapeBorderCommand.h
commands/KoShapeStrokeCommand.h
commands/KoShapeCreateCommand.h
commands/KoShapeDeleteCommand.h
commands/KoShapeDistributeCommand.h
......
......@@ -114,20 +114,20 @@ KoUnit KoCanvasResourceManager::unitResource(int key) const
}
void KoCanvasResourceManager::setActiveBorder(const KoLineBorder &border)
void KoCanvasResourceManager::setActiveStroke(const KoLineBorder &stroke)
{
QVariant v;
v.setValue(border);
setResource(ActiveBorder, v);
v.setValue(stroke);
setResource(ActiveStroke, v);
}
KoLineBorder KoCanvasResourceManager::activeBorder() const
KoLineBorder KoCanvasResourceManager::activeStroke() const
{
if (!d->manager.hasResource(ActiveBorder)) {
if (!d->manager.hasResource(ActiveStroke)) {
KoLineBorder empty;
return empty;
}
return resource(ActiveBorder).value<KoLineBorder>();
return resource(ActiveStroke).value<KoLineBorder>();
}
bool KoCanvasResourceManager::boolResource(int key) const
......
......@@ -70,7 +70,7 @@ public:
enum CanvasResource {
ForegroundColor, ///< The active forground color selected for this canvas.
BackgroundColor, ///< The active background color selected for this canvas.
ActiveBorder, ///< The active border selected for this canvas
ActiveStroke, ///< The active stroke selected for this canvas
PageSize, ///< The size of the (current) page in postscript points.
Unit, ///< The unit of this canvas
CurrentPage, ///< The current page number
......@@ -158,11 +158,11 @@ public:
*/
KoColor backgroundColor() const;
/// Sets the border resource
void setActiveBorder(const KoLineBorder &border);
/// Sets the stroke resource
void setActiveStroke(const KoLineBorder &stroke);
/// Returns the border resource
KoLineBorder activeBorder() const;
/// Returns the stroke resource
KoLineBorder activeStroke() const;
/**
* Return the resource determined by param key as a boolean.
......
......@@ -42,7 +42,7 @@ KoConnectionShapeFactory::KoConnectionShapeFactory()
KoShape* KoConnectionShapeFactory::createDefaultShape(KoDocumentResourceManager *) const
{
KoConnectionShape * shape = new KoConnectionShape();
shape->setBorder(new KoLineBorder());
shape->setStroke(new KoLineBorder());
shape->setShapeId(KoPathShapeId);
return shape;
}
......
......@@ -78,7 +78,7 @@ namespace KoFlake
*/
enum StyleType {
Background, ///< the background / fill style is active
Foreground ///< the foreground / border style is active
Foreground ///< the foreground / stroke style is active
};
/// clones the given gradient
......
......@@ -25,7 +25,7 @@
#include <QDebug>
/**
* An Insets object is a representation of the borders of a shape.
* An Insets object is a representation of the strokes of a shape.
*/
struct FLAKE_EXPORT KoInsets
{
......
......@@ -68,7 +68,7 @@ KoLineBorder::KoLineBorder()
}
KoLineBorder::KoLineBorder(const KoLineBorder &other)
: KoShapeBorderModel(), d(new Private())
: KoShapeStrokeModel(), d(new Private())
{
d->color = other.d->color;
d->pen = other.d->pen;
......@@ -110,7 +110,7 @@ void KoLineBorder::fillStyle(KoGenStyle &style, KoShapeSavingContext &context) c
KoOdfGraphicStyles::saveOdfStrokeStyle(style, context.mainStyles(), pen);
}
void KoLineBorder::borderInsets(const KoShape *shape, KoInsets &insets) const
void KoLineBorder::strokeInsets(const KoShape *shape, KoInsets &insets) const
{
Q_UNUSED(shape);
qreal lineWidth = d->pen.widthF();
......
......@@ -23,7 +23,7 @@
#define KOLINEBORDER_H
#include "KoInsets.h"
#include "KoShapeBorderModel.h"
#include "KoShapeStrokeModel.h"
#include "flake_export.h"
......@@ -35,7 +35,7 @@ class KoViewConverter;
/**
* A border for shapes that draws a single line around the object.
*/
class FLAKE_EXPORT KoLineBorder : public KoShapeBorderModel
class FLAKE_EXPORT KoLineBorder : public KoShapeStrokeModel
{
public:
/// Constructor for a thin line in black
......@@ -92,10 +92,10 @@ public:
/// Returns the strokes brush
QBrush lineBrush() const;
// pure virtuals from KoShapeStrokeModel implemented here.
virtual void fillStyle(KoGenStyle &style, KoShapeSavingContext &context) const;
virtual void borderInsets(const KoShape *shape, KoInsets &insets) const;
virtual void strokeInsets(const KoShape *shape, KoInsets &insets) const;
virtual bool hasTransparency() const;
virtual void paint(KoShape *shape, QPainter &painter, const KoViewConverter &converter);
virtual void paint(KoShape *shape, QPainter &painter, const KoViewConverter &converter, const QColor &color);
......
......@@ -26,7 +26,7 @@ KoLineBorderFactory::KoLineBorderFactory()
{
}
KoShapeBorderModel * KoLineBorderFactory::createBorder() const
KoShapeStrokeModel * KoLineBorderFactory::createStroke() const
{
return new KoLineBorder();
}
......
......@@ -27,7 +27,7 @@ public:
KoLineBorderFactory();
/// reimplemented
virtual KoShapeBorderModel *createBorder() const;
virtual KoShapeStrokeModel *createStroke() const;
};
#endif
......@@ -24,7 +24,7 @@
#include "KoPathShape.h"
#include "KoPathShape_p.h"
#include "KoPathPoint.h"
#include "KoShapeBorderModel.h"
#include "KoShapeStrokeModel.h"
#include "KoViewConverter.h"
#include "KoPathShapeLoader.h"
#include "KoShapeSavingContext.h"
......@@ -199,7 +199,7 @@ QString KoPathShape::saveStyle(KoGenStyle &style, KoShapeSavingContext &context)
style.addProperty("svg:fill-rule", d->fillRule == Qt::OddEvenFill ? "evenodd" : "nonzero");
KoLineBorder *lineBorder = dynamic_cast<KoLineBorder*>(border());
KoLineBorder *lineBorder = dynamic_cast<KoLineBorder*>(stroke());
qreal lineWidth = 0;
if (lineBorder) {
lineWidth = lineBorder->lineWidth();
......@@ -228,7 +228,7 @@ void KoPathShape::loadStyle(const KoXmlElement & element, KoShapeLoadingContext
#endif
}
KoLineBorder *lineBorder = dynamic_cast<KoLineBorder*>(border());
KoLineBorder *lineBorder = dynamic_cast<KoLineBorder*>(stroke());
qreal lineWidth = 0;
if (lineBorder) {
lineWidth = lineBorder->lineWidth();
......@@ -411,7 +411,7 @@ QRectF KoPathShape::boundingRect() const
// calculate the bounding rect of the transformed outline
QRectF bb;
if (d->startMarker.marker() || d->endMarker.marker()) {
KoLineBorder *lineBorder = dynamic_cast<KoLineBorder*>(border());
KoLineBorder *lineBorder = dynamic_cast<KoLineBorder*>(stroke());
QPen pen;
if (lineBorder) {
pen.setWidthF(lineBorder->lineWidth());
......@@ -421,9 +421,9 @@ QRectF KoPathShape::boundingRect() const
else {
bb = transform.map(outline()).boundingRect();
}
if (border()) {
if (stroke()) {
KoInsets inset;
border()->borderInsets(this, inset);
stroke()->strokeInsets(this, inset);
// calculate transformed border insets
QPointF center = transform.map(QPointF());
......@@ -1114,7 +1114,7 @@ bool KoPathShape::separate(QList<KoPathShape*> & separatedPaths)
KoPathShape *shape = new KoPathShape();
if (! shape) continue;
shape->setBorder(border());
shape->setStroke(stroke());
shape->setShapeId(shapeId());
KoSubpath *newSubpath = new KoSubpath();
......@@ -1379,9 +1379,9 @@ bool KoPathShape::hitTest(const QPointF &position) const
QPointF point = absoluteTransformation(0).inverted().map(position);
const QPainterPath outlinePath = outline();
if (border()) {
if (stroke()) {
KoInsets insets;
border()->borderInsets(this, insets);
stroke()->strokeInsets(this, insets);
QRectF roi(QPointF(-insets.left, -insets.top), QPointF(insets.right, insets.bottom));
roi.moveCenter(point);
if (outlinePath.intersects(roi) || outlinePath.contains(roi))
......
......@@ -48,7 +48,7 @@ KoShape *KoPathShapeFactory::createDefaultShape(KoDocumentResourceManager *) con
path->curveTo(QPointF(0, 120), QPointF(50, 120), QPointF(50, 50));
path->curveTo(QPointF(50, -20), QPointF(100, -20), QPointF(100, 50));
path->normalize();
path->setBorder(new KoLineBorder(1.0));
path->setStroke(new KoLineBorder(1.0));
return path;
}
......
......@@ -29,7 +29,7 @@
#include "KoSelection.h"
#include "KoPointerEvent.h"
#include "KoInsets.h"
#include "KoShapeBorderModel.h"
#include "KoShapeStrokeModel.h"
#include "KoShapeBackground.h"
#include "KoColorBackground.h"
#include "KoGradientBackground.h"
......@@ -75,13 +75,13 @@
// KoShapePrivate
KoShapePrivate::KoShapePrivate(KoShape *shape)
: size(50, 50),
: q_ptr(shape),
size(50, 50),
parent(0),
userData(0),
appData(0),
stroke(0),
fill(0),
border(0),
q_ptr(shape),
shadow(0),
clipPath(0),
filterEffectStack(0),
......@@ -116,8 +116,8 @@ KoShapePrivate::~KoShapePrivate()
}
delete userData;
delete appData;
if (border && !border->deref())
delete border;
if (stroke && !stroke->deref())
delete stroke;
if (shadow && !shadow->deref())
delete shadow;
if (fill && !fill->deref())
......@@ -138,13 +138,13 @@ void KoShapePrivate::shapeChanged(KoShape::ChangeType type)
shape->shapeChanged(type, q);
}
void KoShapePrivate::updateBorder()
void KoShapePrivate::updateStroke()
{
Q_Q(KoShape);
if (border == 0)
if (stroke == 0)
return;
KoInsets insets;
border->borderInsets(q, insets);
stroke->strokeInsets(q, insets);
QSizeF inner = q->size();
// update left
q->update(QRectF(-insets.left, -insets.top, insets.left,
......@@ -357,9 +357,9 @@ bool KoShape::hitTest(const QPointF &position) const
QPointF point = absoluteTransformation(0).inverted().map(position);
QRectF bb(QPointF(), size());
if (d->border) {
if (d->stroke) {
KoInsets insets;
d->border->borderInsets(this, insets);
d->stroke->strokeInsets(this, insets);
bb.adjust(-insets.left, -insets.top, insets.right, insets.bottom);
}
if (bb.contains(point))
......@@ -382,9 +382,9 @@ QRectF KoShape::boundingRect() const
QTransform transform = absoluteTransformation(0);
QRectF bb = outlineRect();
if (d->border) {
if (d->stroke) {
KoInsets insets;
d->border->borderInsets(this, insets);
d->stroke->strokeInsets(this, insets);
bb.adjust(-insets.left, -insets.top, insets.right, insets.bottom);
}
bb = transform.mapRect(bb);
......@@ -721,12 +721,12 @@ qreal KoShape::transparency(bool recursive) const
}
}
KoInsets KoShape::borderInsets() const
KoInsets KoShape::strokeInsets() const
{
Q_D(const KoShape);
KoInsets answer;
if (d->border)
d->border->borderInsets(this, answer);
if (d->stroke)
d->stroke->strokeInsets(this, answer);
return answer;
}
......@@ -1083,23 +1083,23 @@ bool KoShape::collisionDetection()
return d->detectCollision;
}
KoShapeBorderModel *KoShape::border() const
KoShapeStrokeModel *KoShape::stroke() const
{
Q_D(const KoShape);
return d->border;
return d->stroke;
}
void KoShape::setBorder(KoShapeBorderModel *border)
void KoShape::setStroke(KoShapeStrokeModel *stroke)
{
Q_D(KoShape);
if (border)
border->ref();
d->updateBorder();
if (d->border)
d->border->deref();
d->border = border;
d->updateBorder();
d->shapeChanged(BorderChanged);
if (stroke)
stroke->ref();
d->updateStroke();
if (d->stroke)
d->stroke->deref();
d->stroke = stroke;
d->updateStroke();
d->shapeChanged(StrokeChanged);
notifyChanged();
}
......@@ -1187,7 +1187,7 @@ QString KoShape::saveStyle(KoGenStyle &style, KoShapeSavingContext &context) con
{
Q_D(const KoShape);
// and fill the style
KoShapeBorderModel *b = border();
KoShapeStrokeModel *b = stroke();
if (b) {
b->fillStyle(style, context);
}
......@@ -1287,16 +1287,16 @@ void KoShape::loadStyle(const KoXmlElement &element, KoShapeLoadingContext &cont
delete d->fill;
d->fill = 0;
}
if (d->border && !d->border->deref()) {
delete d->border;
d->border = 0;
if (d->stroke && !d->stroke->deref()) {
delete d->stroke;
d->stroke = 0;
}
if (d->shadow && !d->shadow->deref()) {
delete d->shadow;
d->shadow = 0;
}
setBackground(loadOdfFill(context));
setBorder(loadOdfStroke(element, context));
setStroke(loadOdfStroke(element, context));
setShadow(d->loadOdfShadow(context));
QString protect(styleStack.property(KoXmlNS::style, "protect"));
......@@ -1485,7 +1485,7 @@ KoShapeBackground *KoShape::loadOdfFill(KoShapeLoadingContext &context) const
return bg;
}
KoShapeBorderModel *KoShape::loadOdfStroke(const KoXmlElement &element, KoShapeLoadingContext &context) const
KoShapeStrokeModel *KoShape::loadOdfStroke(const KoXmlElement &element, KoShapeLoadingContext &context) const
{
KoStyleStack &styleStack = context.odfLoadingContext().styleStack();
KoOdfStylesReader &stylesReader = context.odfLoadingContext().stylesReader();
......@@ -1494,41 +1494,41 @@ KoShapeBorderModel *KoShape::loadOdfStroke(const KoXmlElement &element, KoShapeL
if (stroke == "solid" || stroke == "dash") {
QPen pen = KoOdfGraphicStyles::loadOdfStrokeStyle(styleStack, stroke, stylesReader);
KoLineBorder *border = new KoLineBorder();
KoLineBorder *stroke = new KoLineBorder();
if (styleStack.hasProperty(KoXmlNS::calligra, "stroke-gradient")) {
QString gradientName = styleStack.property(KoXmlNS::calligra, "stroke-gradient");
QBrush brush = KoOdfGraphicStyles::loadOdfGradientStyleByName(stylesReader, gradientName, size());
border->setLineBrush(brush);
stroke->setLineBrush(brush);
} else {
border->setColor(pen.color());
stroke->setColor(pen.color());
}
#ifndef NWORKAROUND_ODF_BUGS
KoOdfWorkaround::fixPenWidth(pen, context);
#endif
border->setLineWidth(pen.widthF());
border->setJoinStyle(pen.joinStyle());
border->setLineStyle(pen.style(), pen.dashPattern());
border->setCapStyle(pen.capStyle());
stroke->setLineWidth(pen.widthF());
stroke->setJoinStyle(pen.joinStyle());
stroke->setLineStyle(pen.style(), pen.dashPattern());
stroke->setCapStyle(pen.capStyle());
return border;
return stroke;
#ifndef NWORKAROUND_ODF_BUGS
} else if (stroke.isEmpty()) {
QPen pen = KoOdfGraphicStyles::loadOdfStrokeStyle(styleStack, "solid", stylesReader);
if (KoOdfWorkaround::fixMissingStroke(pen, element, context, this)) {
KoLineBorder *border = new KoLineBorder();
KoLineBorder *stroke = new KoLineBorder();
#ifndef NWORKAROUND_ODF_BUGS
KoOdfWorkaround::fixPenWidth(pen, context);
#endif
border->setLineWidth(pen.widthF());
border->setJoinStyle(pen.joinStyle());
border->setLineStyle(pen.style(), pen.dashPattern());
border->setCapStyle(pen.capStyle());
border->setColor(pen.color());
stroke->setLineWidth(pen.widthF());
stroke->setJoinStyle(pen.joinStyle());
stroke->setLineStyle(pen.style(), pen.dashPattern());
stroke->setCapStyle(pen.capStyle());
stroke->setColor(pen.color());
return border;
return stroke;
}
#endif
}
......
......@@ -45,7 +45,7 @@ class QRectF;
class QPainterPath;
class KoShapeContainer;
class KoShapeBorderModel;
class KoShapeStrokeModel;
class KoShapeBackground;
class KoShapeManager;
class KoShapeUserData;
......@@ -122,7 +122,7 @@ public:
ParentChanged, ///< used after a setParent()
CollisionDetected, ///< used when another shape moved in our boundingrect
Deleted, ///< the shape was deleted
BorderChanged, ///< the shapes border has changed
StrokeChanged, ///< the shapes stroke has changed
BackgroundChanged, ///< the shapes background has changed
ShadowChanged, ///< the shapes shadow has changed
ParameterChanged, ///< the shapes parameter has changed (KoParameterShape only)
......@@ -256,7 +256,7 @@ public:
* scaling is a so called secondary operation which is comparable to zooming in
* instead of changing the size of the basic shape.
* Easiest example of this difference is that using this method will not distort the
* size of pattern-fills and borders.
* size of pattern-fills and strokes.
*/
virtual void setSize(const QSizeF &size);
......@@ -622,7 +622,7 @@ public:
/**
* returns the outline of the shape in the form of a path.
* The outline returned will always be relative to the position() of the shape, so
* moving the shape will not alter the result. The outline is used to draw the border
* moving the shape will not alter the result. The outline is used to draw the stroke
* on, for example.
* @returns the outline of the shape in the form of a path.
*/
......@@ -638,22 +638,22 @@ public:
virtual QRectF outlineRect() const;
/**
* Returns the currently set border, or 0 if there is no border.
* @return the currently set border, or 0 if there is no border.
* Returns the currently set stroke, or 0 if there is no stroke.
* @return the currently set stroke, or 0 if there is no stroke.
*/
KoShapeBorderModel *border() const;
KoShapeStrokeModel *stroke() const;
/**
* Set a new border, removing the old one.
* @param border the new border, or 0 if there should be no border.
* Set a new stroke, removing the old one.
* @param stroke the new stroke, or 0 if there should be no stroke.
*/
void setBorder(KoShapeBorderModel *border);
void setStroke(KoShapeStrokeModel *stroke);
/**
* Return the insets of the border.
* Convenience method for KoShapeBorderModel::borderInsets()
* Return the insets of the stroke.
* Convenience method for KoShapeStrokeModel::strokeInsets()
*/
KoInsets borderInsets() const;
KoInsets strokeInsets() const;
/// Sets the new shadow, removing the old one
void setShadow(KoShapeShadow *shadow);
......@@ -1053,7 +1053,7 @@ protected:
/**
* @brief Saves the style used for the shape
*
* This method fills the given style object with the border and
* This method fills the given style object with the stroke and
* background properties and then adds the style to the context.
*
* @param style the style object to fill
......@@ -1072,7 +1072,7 @@ protected:
virtual void loadStyle(const KoXmlElement &element, KoShapeLoadingContext &context);
/// Loads the stroke style
KoShapeBorderModel *loadOdfStroke(const KoXmlElement &element, KoShapeLoadingContext &context) const;
KoShapeStrokeModel *loadOdfStroke(const KoXmlElement &element, KoShapeLoadingContext &context) const;
/// Loads the shadow style
KoShapeBackground *loadOdfFill(KoShapeLoadingContext &context) const;
......
......@@ -22,7 +22,7 @@
#include "flake_export.h"
class KoShapeBorderModel;
class KoShapeStrokeModel;
class FLAKE_EXPORT KoShapeBorderFactoryBase
{
......@@ -39,7 +39,7 @@ public:
* The default shape position is not relevant, it will be moved by the caller.
* @return a new shape
*/
virtual KoShapeBorderModel *createBorder() const = 0;
virtual KoShapeStrokeModel *createBorder() const = 0;
/**
* return the id for the shape this factory creates.
......
......@@ -20,7 +20,7 @@
#include "KoShapeContainer.h"
#include "KoShapeContainer_p.h"
#include "KoShapeContainerModel.h"
#include "KoShapeBorderModel.h"
#include "KoShapeStrokeModel.h"
#include "KoShapeContainerDefaultModel.h"
#include "KoShapeSavingContext.h"
......@@ -196,10 +196,10 @@ void KoShapeContainer::paint(QPainter &painter, const KoViewConverter &converter
painter.setTransform(shape->absoluteTransformation(&converter) * baseMatrix);
shape->paint(painter, converter, paintcontext);
painter.restore();
if (shape->border()) {
if (shape->stroke()) {
painter.save();
painter.setTransform(shape->absoluteTransformation(&converter) * baseMatrix);
shape->border()->paint(shape, painter, converter);
shape->stroke()->paint(shape, painter, converter);
painter.restore();
}
}
......
......@@ -28,7 +28,7 @@
#include "KoXmlWriter.h"
#include "KoXmlReader.h"
#include "KoShapeRegistry.h"
#include "KoShapeBorderModel.h"
#include "KoShapeStrokeModel.h"
#include "KoShapeShadow.h"
#include <QPainter>
......@@ -228,13 +228,13 @@ void KoShapeGroup::shapeChanged(ChangeType type, KoShape *shape)
Q_UNUSED(shape);
KoShapeContainer::shapeChanged(type, shape);
switch (type) {
case KoShape::BorderChanged:
case KoShape::StrokeChanged:
{
KoShapeBorderModel *stroke = border();
if (stroke) {
if (stroke->deref())
delete stroke;
setBorder(0);
KoShapeStrokeModel *str = stroke();
if (str) {
if (str->deref())
delete str;
setStroke(0);
}
break;
}
......
......@@ -28,7 +28,7 @@
#include "KoShape_p.h"
#include "KoCanvasBase.h"
#include "KoShapeContainer.h"
#include "KoShapeBorderModel.h"
#include "KoShapeStrokeModel.h"
#include "KoShapeGroup.h"
#include "KoToolProxy.h"
#include "KoShapeManagerPaintingStrategy.h"
......@@ -372,9 +372,9 @@ void KoShapeManager::paintShape(KoShape *shape, QPainter &painter, const KoViewC
painter.save();
shape->paint(painter, converter, paintContext);
painter.restore();
if (shape->border()) {
if (shape->stroke()) {
painter.save();
shape->border()->paint(shape, painter, converter);
shape->stroke()->paint(shape, painter, converter);
painter.restore();
}
} else {
......@@ -414,9 +414,9 @@ void KoShapeManager::paintShape(KoShape *shape, QPainter &painter, const KoViewC
imagePainter.save();
shape->paint(imagePainter, converter, paintContext);
imagePainter.restore();
if (shape->border()) {
if (shape->stroke()) {
imagePainter.save();
shape->border()->paint(shape, imagePainter, converter);
shape->stroke()->paint(shape, imagePainter, converter);
imagePainter.restore();
}
imagePainter.end();
......
......@@ -26,7 +26,7 @@
#include "KoShapeManagerPaintingStrategy.h"
#include "KoShape.h"
#include "KoViewConverter.h"
#include "KoShapeBorderModel.h"
#include "KoShapeStrokeModel.h"
#include "KoShapeGroup.h"
#include "KoShapeContainer.h"
......
......@@ -24,7 +24,7 @@
#include "KoShapeGroup.h"
#include "KoSelection.h"
#include "KoShapeSavingContext.h"
#include "KoShapeBorderModel.h"
#include "KoShapeStrokeModel.h"
#include "KoShape.h"
#include "KoInsets.h"
#include "KoUnit.h"
......@@ -105,7 +105,7 @@ void KoShapeShadow::Private::paintShadow(KoShape *shape, QPainter &painter, cons
painter.restore();
}
if (shape->border()) {
if (shape->stroke()) {
painter.save();
QTransform oldPainterMatrix = painter.transform();
KoShape::applyConversion(painter, converter);
......@@ -116,7 +116,7 @@ void KoShapeShadow::Private::paintShadow(KoShape *shape, QPainter &painter, cons
// compensate applyConversion call in paint
QTransform scaleMatrix = newPainterMatrix * oldPainterMatrix.inverted();
painter.setTransform(scaleMatrix.inverted() * painter.transform());
shape->border()->paint(shape, painter, converter);
shape->stroke()->paint(shape, painter, converter);
painter.restore();
}
}
......