OGL patch from Shane Holloway:

Two simple problems found in the new python ogl code.  First is
    the patch for _canvas.py.  Essentially:

        dx = abs(dc.LogicalToDeviceX(x - self._firstDragX))
        dy = abs(dc.LogicalToDeviceY(y - self._firstDragY))

    was incorrect because (x,y) and (self._firstDragX,
    self._firstDragY) are both already in Logical coordinates.
    Therefore the difference between the two is also in logical
    coordinates, and the conversion call is an error.  This bug
    surfaces when you have OGL on a scrollwin, and you are far from
    the origin of the canvas.

    The second change in _composit.py basically removes the assumption
    that the child is in both self._children and self._divisions.
    Causes many problems when it's not.  ;)


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30415 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2004-11-10 18:14:45 +00:00
parent b40a6748eb
commit ca8071ca9f
3 changed files with 38 additions and 6 deletions

View File

@@ -1,6 +1,33 @@
Recent Changes for wxPython Recent Changes for wxPython
===================================================================== =====================================================================
2.5.3.2
-------
OGL patch from Shane Holloway:
Two simple problems found in the new python ogl code. First is
the patch for _canvas.py. Essentially:
dx = abs(dc.LogicalToDeviceX(x - self._firstDragX))
dy = abs(dc.LogicalToDeviceY(y - self._firstDragY))
was incorrect because (x,y) and (self._firstDragX,
self._firstDragY) are both already in Logical coordinates.
Therefore the difference between the two is also in logical
coordinates, and the conversion call is an error. This bug
surfaces when you have OGL on a scrollwin, and you are far from
the origin of the canvas.
The second change in _composit.py basically removes the assumption
that the child is in both self._children and self._divisions.
Causes many problems when it's not. ;)
2.5.3.1 2.5.3.1
------- -------

View File

@@ -93,9 +93,12 @@ class ShapeCanvas(wx.ScrolledWindow):
# If we're very close to the position we started dragging # If we're very close to the position we started dragging
# from, this may not be an intentional drag at all. # from, this may not be an intentional drag at all.
if dragging: if dragging:
dx = abs(dc.LogicalToDeviceX(x - self._firstDragX)) if self._checkTolerance:
dy = abs(dc.LogicalToDeviceY(y - self._firstDragY)) # the difference between two logical coordinates is a logical coordinate
if self._checkTolerance and (dx <= self.GetDiagram().GetMouseTolerance()) and (dy <= self.GetDiagram().GetMouseTolerance()): dx = abs(x - self._firstDragX)
dy = abs(y - self._firstDragY)
toler = self.GetDiagram().GetMouseTolerance()
if (dx <= toler) and (dy <= toler):
return return
# If we've ignored the tolerance once, then ALWAYS ignore # If we've ignored the tolerance once, then ALWAYS ignore
# tolerance in this drag, even if we come back within # tolerance in this drag, even if we come back within

View File

@@ -552,7 +552,9 @@ class CompositeShape(RectangleShape):
"""Removes the child from the composite and any constraint """Removes the child from the composite and any constraint
relationships, but does not delete the child. relationships, but does not delete the child.
""" """
if child in self._children:
self._children.remove(child) self._children.remove(child)
if child in self._divisions:
self._divisions.remove(child) self._divisions.remove(child)
self.RemoveChildFromConstraints(child) self.RemoveChildFromConstraints(child)
child.SetParent(None) child.SetParent(None)