Breakpoint HoldX/Y problem
Posted: 10 Dec 2013 18:07
Lemur 4.1.2 on iPad 4, Lemur editor 4.1.1 on Windows.
Note - an even easier way to see the issue is to create a breakpoint in a new project, move the points around, and then simply set holdX or holdY to 1 in the behavior tab. The manual says that each breakpoint can be held by using a vector and that does seem to work, but the extra lines on the screen are quite unfortunate.
I have some code that is manipulating breakpoints. I want to move them programatically and not allow the user to move them. I'm using holdX and holdY to accomplish it. However, when I try to use them, weirdness results. I think there's some bug in the logic. I get artifact lines running to the edges as if there's points out there that are being connected. The lines connecting them are not fat/bolded like the breakpoint lines I'm trying to draw and some of the new lines are not showing up.
Basically - has anyone played with Breakpoints holdX, holdY?
Here's the code:
Note - an even easier way to see the issue is to create a breakpoint in a new project, move the points around, and then simply set holdX or holdY to 1 in the behavior tab. The manual says that each breakpoint can be held by using a vector and that does seem to work, but the extra lines on the screen are quite unfortunate.
I have some code that is manipulating breakpoints. I want to move them programatically and not allow the user to move them. I'm using holdX and holdY to accomplish it. However, when I try to use them, weirdness results. I think there's some bug in the logic. I get artifact lines running to the edges as if there's points out there that are being connected. The lines connecting them are not fat/bolded like the breakpoint lines I'm trying to draw and some of the new lines are not showing up.
Basically - has anyone played with Breakpoints holdX, holdY?
Here's the code:
Code: Select all
decl numPts, op, objRect, i, holdEm, clearEm;
// these 3 lines are figuring out what to display - not relevant to the problem
currentAlg = floor(selection);
algCfg = algorithms[currentAlg];
bpCfg = brkpoints[currentAlg];
// get the current number of breakpoints and create a vector of zeros
numPts = getattribute(Breakpoint, 'nbr');
clearEm = stretch(0, numPts);
// get the number of breakpoints in the new configuration and create a vector of ones
numPts = bpCfg.value[0];
holdEm = stretch(1, numPts);
// release the old points so they can move.
Breakpoint.holdX = clearEm;
Breakpoint.holdY = clearEm;
// set the new number of breakpoints and set their x,y values
setattribute(Breakpoint, 'nbr', numPts);
Breakpoint.x = subarray(bpCfg.value, 1, numPts);
Breakpoint.y = subarray(bpCfg.value, 1+numPts, numPts);
// lock the points from being edited
Breakpoint.holdX = holdEm;
Breakpoint.holdY = holdEm;