Skip to main content
Participant
December 30, 2007
Question

Direction lines disappear during mouse drag

  • December 30, 2007
  • 1 reply
  • 673 views
In a plug-in tool for CS3 that I'm writing the in- or out handle of a path's direction line can be selected and dragged around. The path shape is correctly updated while dragging. However, the direction lines are hidden while dragging and are only displayed again when the mouse button is released. Does anybody know how to prevent the direction lines from disappearing while dragging with the mouse?

My code is based on the MultiArrowTool sample that comes with the SDK and the two relevant sections are listed below. Here, hitRef is a global variable.

extern AIErr toolMouseDown( AIToolMessage *message ) {

AIErr error = kNoErr;

error = sAIHitTest->HitTest( NULL, &message->cursor, kAllHitRequest, &hitRef);
if ( error )
goto error;

error:
return error;
}

extern AIErr toolMouseDrag( AIToolMessage *message )
{
AIErr error = kNoErr;
AIToolHitData hitData;
AIPathSegment hitSegment;
AIArtHandle hitArt;

error = sAIUndo->UndoChanges( );
if (sAIHitTest->IsHit(hitRef))
{
sAIHitTest->GetHitData(hitRef, &hitData);

if (hitData.type == kInHitType)
{
hitArt = sAIHitTest->GetArt(hitRef);
sAIPath->GetPathSegments(hitArt, hitData.segment, 1, &hitSegment);
hitSegment.out = message->cursor;
sAIPath->SetPathSegments( hitArt, hitData.segment, 1, &hitSegment );
}
else if (hitData.type == kOutHitType)
{
hitArt = sAIHitTest->GetArt(hitRef);
sAIPath->GetPathSegments(hitArt, hitData.segment, 1, &hitSegment );
hitSegment.in = message->cursor;
sAIPath->SetPathSegments( hitArt, hitData.segment, 1, &hitSegment );
}
};

return error;
}

Anybody who can help me?

Regards,

Peter
This topic has been closed for replies.

1 reply

_petervH_Author
Participant
January 13, 2008
There doesn't seem to be a solution other than drawing the handles yourself using the Annotator and ADMDrawer suites.

The post in this forum titled "Drawing directly in the document window" is a good starting point.

Peter