switch (to) {
case SCREEN:
if (scale > 0) {
double dX = -(position.getX() * scale) + mapWidth / 2;
double dY = position.getY() * scale + mapHeight / 2;
return new MatrixImpl(scale, 0, 0, -scale, dX, dY);
}
return new MatrixImpl(1, 0, 0, 1, 0, 0);
case WORLD:
return Matrix.IDENTITY;
}
}
return null;