Warnings using noSmooth() in setup()

Hello,

Can anyone help me understand what is happening here?

Ok:


Ok:

?

?

?

:)

2 Likes

I’m not sure if it is a bug or not … seems like one to me.

this works though …

void settings() {
  if (true) noSmooth();
}
2 Likes

Still trying to understand the “why” of these error messages when it should work in setup().
See previous post.

Two more examples below; I thought I would try Processing 4.

Using example from reference:
https://processing.org/reference/noSmooth_.html

Processing 3.5.4 (no error msg)

Processing 4.0a1 (error msg)

:)

1 Like

It certainly puzzled me.

I would really like to know why.

I will consider this as a Processing quirk for now and have my workarounds.

:)

1 Like

I noticed some issues file on the processing repo dealing with noSmooth(), none are this exact issue, but seems the method may be buggy.

I would file an issue and see what comes of it.

2 Likes

If you check the java code emitted by the preprocessor, you will find size and smooth have been moved to settings from setup.

public void settings(){
   size(200, 200);
}
 ....
}

How, would the preprocessor know how to deal with your code? You should explicitly use settings in the ide to do any thing fancy with size, smooth, noSmooth… You also need to know settings gets called before setup. This is essentially a legacy issue from when processing.org found they needed to deal with size ahead of setup, but did not want to mess with legacy code (would have made books etc look a bit silly as the they refer to using size in setup) but it is not without consequences.

5 Likes

That’s right – preprocessor attempts to move commands including size and smooth / noSmooth from setup into settings “auto-magically”. It seems like perhaps you have found ANT parser errors that prevent it from matching and moving noSmooth in specific edge cases. I would suggest opening a bug report.

It is still possible (unlikely, but possible) that, going forward, Processing could ditch most of this automagic in Processing 4 and instead document in the reference and in error messages when you are required to use settings().

2 Likes