If you really do need to make all these changes, I'd like more documentation.  What are originX and originY? What are left and top?  If you document these all, then I can verify the calculations in the rest of the code.  As it is, I don't really understand what is going on.