Diffusion Krita 6f51599f3719

Implement KoShape::updateAbsolute() for complex transformation updates

Authored by dkazakov on Jun 16 2017, 8:51 AM.

Description

Implement KoShape::updateAbsolute() for complex transformation updates

Historically, transformation code uses extremely weird method of shape
updates that rely on the event loop. This patch implements a framework
for moving away from this strategy.

The problem:

When one transforms a shape he needs to update both areas: bounding
rect of the shape *before* the transform and a bounding rect of the shape
*after* the transform. Before the patch, the transformation code used the
system like that:

shape->update();
shape->setTransformation(newTransform);
shape->update();

That works only with assumption that the first update() call will *not*
be executed before setTransform() call. That should be true atm, but it
is not guaranteed to be so in the future. Therefore, now the update happens
like that:

const QRectF oldDirtyRect = shape->boundingRect();
shape->setTransformation(newTransform);
shape->updateAbsolute(oldDirtyRect | shape->boundingRect());

Details

Committed
dkazakovJun 16 2017, 10:01 AM
Parents
R37:cb6516b8653a: Fix artifacts when rendering shapes with miter join set
Branches
Unknown
Tags
Unknown