adjust for margin in g element
account for margin in pan calculation