OpenEndedGroup / Field

A development environment for art
201 stars 22 forks source link

peculiarity with FLine().append() #39

Open highfellow opened 11 years ago

highfellow commented 11 years ago

I'm not sure if this is intended, but the way it stands the only way I've found to add the contents of one FLine to another is by using:

line1.append(line2.__dict__['line'])

not

line.append(line2)

I guess this is another bug from moving PLines over to FLines?

This is the test code I'm using:

line = FLine().moveTo(0,300).lineTo(0,400).lineTo(100,300).lineTo(100,400)

line3 = line.copy().cursor(2).split()[1]
line = line.cursor(1).splitLeft()
line.append(line3.__dict__['line'])

_self.lines.clear()
_self.lines.add(line)
highfellow commented 11 years ago

Sorry, I got this mixed up.

I think the explanation isn't to do with FLine().append(), but with Cursor.split(). This returns a PLine not an FLine, and the way to convert back to an FLine is to get its dict['line'] attribute.