Klaas Holwerda wrote:
> Glaz wrote:
>> Hi again,
The next code works fine, if i add some named children to a canvasobject, it
breaks at the right object hit.
And i don't see a difference with your code.
So i wonder if there is a bug somewhere, which depends on the design/drawing
(e.g. top/root object in view has non
identity matrix.).
void a2dStToolContr::OnMouseEvent(wxMouseEvent& event)
{
wxPoint pos = event.GetPosition();
m_mouse_x = pos.x;
m_mouse_y = pos.y;
ShowMouse();
double xw = GetCanvasView()->GetDrawer2D()->DeviceToWorldX( m_mouse_x );
double yw = GetCanvasView()->GetDrawer2D()->DeviceToWorldY( m_mouse_y );
a2dCanvasObject *a2dCanObj = GetCanvasView()->IsHitWorld( xw, yw );
a2dIterC ic( GetCanvasView() );
ic.SetPerLayerMode( true );
a2dHitEvent hitEvent = a2dHitEvent( xw, yw, false );
// The mouse is moving.
if( event.Moving() )
{
// The mouse is over an object.
if( a2dCanObj )
{
a2dCanvasObject *handle = a2dCanObj->ChildIsHitWorld( ic, hitEvent
);
if( handle )
{
handle = a2dCanObj->ChildIsHitWorld( ic, hitEvent );
wxString nn = handle->GetName();
if( nn == "noot" )
handle = handle;
}
}
}
--
Unclassified
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Wxart2d-users_dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wxart2d-users_dev