[GREENFOOT-311] Text line wrapping in GreenfootImage constructor
A new GreenfootImage constructor was added in version 2.0.1.
!GreenfootImage(String string, int size, Color foreground, Color background)
Its a great idea and will be helpful for students. However, the line wrapping does not work the same on Windows and Mac systems because of the following:
{noformat} string.split(System.getProperty("line.separator")) {noformat}
Instead, the command should be: {noformat} string.split(System.getProperty("\n")) {noformat}
The reason is that Java saves "\n" in a string as a newline and does not use the system's line separator.
You can work around this problem by using "\r\n" as line separators on Windows but then it would not work on Mac. It seems better not to have to write platform specific code. :)
Issue metadata
- Issue type: Bug
- Priority: Low
- Fix versions: 2.1.0