Is there a way to create a polygon based on 2 points?

As the title says, I am trying to find a way to create a polygon by using only 2 points selected by the user (Handled by left mouse click command). Polyline was the easier route for this, but the problem is that the polyline seems to resize/scale up and down depending on the zoom value of the viewer.

Would like to hear any input on this.