"For [verb]ing" vs "to [verb]"
Solution 1:
Both sentences are grammatically correct, and as such the edit was unnecessary. However, adding a comma after need in the second sentence would also be unnecessary, though not strictly incorrect.
Both sentences are using a non-finite verb form to indicate intent. In English, you can usually use either a gerund (as in the first example) or an infinitive (as in the second example), with little or no difference in meaning. When there is a difference, the gerund version tends to indicate a general need, while the infinitive indicates a specific, immediate need:
- I want more sugar for making frosting. (Making frosting is something I do regularly, and I need more sugar to keep it up.)
- I want more sugar to make frosting. (I'm making frosting right now, and I need more sugar.)
Assuming that you meant something like #1, changing it to #2 is potentially a subtle change in meaning.
However, this distinction is not consistent, and depends heavily on context.
Solution 2:
As noted in other answers, both sentences are grammatically correct. The problem you perceive with the second (which contains "I need to hide") may be its garden path nature that occurs because of need to. The reader is misled to think incorrectly in terms of a phrasal verb: "{I need to hide} {the straight lines}", versus correct "{I need} {to hide the straight lines}". One solution is to revise the sentence, perhaps as:
• As you see, when the circle becomes bigger I need more vertices to hide the straight lines.
• As you see, to avoid straight lines when the circle grows, I need more vertices.
Solution 3:
If you are talking about general purpose or what a thing is generally used for, you can use either "to" or "for."
For example,
I use a broom for sweeping the floor.
I use a broom to sweep the floor.
I suppose the person who corrected you was considering the presence of the word "need." The word is usually taught followed by an infinitive:
need + noun + to v
But because of the usage I mentioned first, it isn't necessary to change "for."