The matlab function getline (image processing toolbox) returns the position of a polyline (which has previously been defined with the cursor) either on a double-click or on pressing the return key or spacebar.
Due to my butter-fingers and accidentally double-clicking I want to remove the ability to end on a double-click.
What part do I need to change, or what functions should I be looking out for, I can’t find out how a double click is even defined in matlab.
Cheers!
MATLAB associates “callback” functions with graphics objects, which define what to do when the mouse is clicked, keys are pressed, etc.. In
getline(), the section to look at is theNextButtonDown()subfunction. This is the callback that is associated with subsequent mouse presses after the first mouse press to initiate the line. The key is that is checks theSelectionTypefigure property, which will beopenfor a double click. When that is the case, it closes the figure. So, to disable that functionality, just remove the extra case and checking logic. Here is the diff for my r2009b version: