refactoring serverside. Fixed bug that x/y origin was not passed when scaling