You can reference this.$scope.height here so you don't have to do the math twice.  Same with width.