Your first moveToPoint call hard-codes the x position to 0. If you want to start at the right edge of your rectangle, shouldn't you change that first moveToPoint line to pass in your rect's origin.x as the starting point?
Then you also need to change any code that calculates points in your path purely from the width/height use width+origin.x or height+origin.y, so when you shift the origin of your rectangle, all the points in the rectangle shift as well.