You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for another helpful report. This will show up fixed when the server is updated next. However, there's some nuance to this fix, and I'd like to document that here.
Before this fix, set-plot-pen-color did not really do anything at all in NetLogo Web (even though it theoretically should have—my mistake). When I initially implemented plotting, I tried to accommodate for NetLogo's quirky ability to have a multicolored plot pen trail, but telling the plotting library to handle that (incredibly atypical) case made plotting performance absolutely awful, and it only updated the plot marker dots, not the lines. I couldn't really find any good plotting library that supported lines that would partially changed colors, so it seems to me that that (anti-)feature will just go unsupported in NetLogo Web.
However, that doesn't mean that set-plot-pen-color should do nothing in NetLogo Web. I gave up the "multicolor" feature, but I simply forgot about handling the case reported here, which covers a very sensible and legitimate thing to want to do with a plot pen. In this case, you're not trying to have a multi-colored pen trail; you just want to programatically create a pen and set its color. This is absolutely essential for coloring temporary plot pens (unless we someday change create-temporary-plot-pen to take a color as an argument), and there are other reasons I can imagine for wanting to dynamically set/change the color of your entire plot pen's trail, as well, so the primitive needs to be at least partially supported.
But, anyway, the reason that I write this is not to conduct Software Engineering Story Time. Rather, my goal here is to document a deviation of NetLogo Web from what JVM NetLogo does. In JVM NetLogo, you can have a plot pen start to draw with color1, and then call set-plot-pen-color color2 and have it draw new plot points/trails with color2. This behavior will not be supported in NetLogo Web. Instead, the color provided in the most-recent call of set-plot-pen-color for that pen will be the color used for all of that pen's drawings—past and future.
A workaround for anyone who finds the old behavior absolutely essential to their use case: Create a new pen for each new color.
This model works fine in the desktop version but the line is black in Tortoise (using http://li425-91.members.linode.com:9000/create-standalone):
https://dl.dropboxusercontent.com/u/51973316/temp-pen-color-bug.nlogo
The text was updated successfully, but these errors were encountered: