Updated code to display polygon in editor correctly