Need suggestion for shape geometry change event handling

Boudewijn Rempt boud at valdyas.org
Sat Nov 19 10:46:59 GMT 2011


On Thursday 17 November 2011 Nov, Yue Liu wrote:
> Hello,
> 
> I'm trying to implement connector auto-routing in Flow, it requires
> connector routings being re-calculated everytime a shape's geometry
> changed. So I'm wondering what should be the right way to do this. My
> idea is add virtual method shapeGeometryChanged() in
> KoShapeBasedDocumentBase and use it in those KoShapeXXXCommands, then
> implement it in FlowDocument. But i'm not sure about this idea so i
> want to get your opion about it.

Hm... I'm not sure either. We first need to check what actually happens when the default tool changes the position or size of a shape. Right now, I think that the only thing happening is that the canvas gets an update request, and that's not the right place to hook into to change the position and layout of the other shapes and connectors.

Maybe the whole thing should be built into the default tool itself, or be a plugin to the default tool that kicks in when a shape's position or size changes?


-- 
Boudewijn Rempt
http://www.valdyas.org, http://www.krita.org, http://www.boudewijnrempt.nl



More information about the calligra-devel mailing list