Hi Chris,
The story so far on my GUI FloatCanvas drawing software,
I have all canvas objects with default and extended properties being tracked
using a
properties dictionary attached to each object instance. The dictionary is
destroyed and
rebuilt on a canvas redraw as the objects themselves are similarly destroyed
and redrawn.
Each objects property dictionary is built when the new object is placed on
the canvas.
For this reason, my properties dictionary effectively holds the ‘args’ and
‘kwargs’ that are
used to generate the FloatCanvas object in the first place.
This works well and allows me to throw up a properties frame for each
object. This will
End up being a VB style property control for all of the object on the
canvas.
It therefore follows that positional information is held so that ….
print object_Instance.props[‘XY’] would show as (5,5) say. Not [5.0000000
5.0000000]
So, on to the problem ….
I am using the movingelements.py code to generate a new target position
on an object move…
def OnFCLeftUp(self, event):
if self.Moving:
self.Moving = False
if self.MoveObject is not None:
dxy = event.GetPosition() - self.StartPoint
dxy = self.Canvas.ScalePixelToWorld(dxy)
self.MovingObject.Move(dxy)
and I send this to my new class to using
self.DL.ObjMove(self.MovingObject, dxy)
My DL (DrawingList) class handles canvas redraw using any revised
object information passed through the properties dictionary.
In the above case there will be new XY information sent for the move.
My problem is that when I place ‘dxy’ back into [‘XY’] I have a coordinate
inconsistency. When the newly dropped object is redrawn it doesn’t come
up where it should. I was sort of hoping that it would. So my question is
…
Can you enlighten me on the relationship between the ‘dxy’ and the
FloatCanvas generating XY?
Alternatively, is there an offset depending on the item that is being moved
that
I need to be aware of?
Thanks in advance
David
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.503 / Virus Database: 269.17.2/1185 - Release Date: 15/12/2007
12:00
_______________________________________________
FloatCanvas mailing list
[email protected]
http://mail.mithis.com/cgi-bin/mailman/listinfo/floatcanvas