public void scaleRect(Vector cursor)
    {
        if (pModel.hasSelectedObject() && !pModel.hasMultiSelectionObjects() && 
                pModel.getSelectedObject() instanceof Square)
        {
            Square rect = (Square) pModel.getSelectedObject();
            
            Vector localCursor = Util.minus(cursor, rect.getPosition());
            
            Matrix inverseRotationMatrix = new Transformation.Rotation(-rect.getRotationAngle()).getMatrix();
            Vector distanceVector = inverseRotationMatrix.multVector(localCursor);
            
            rect.setSize(Math.abs(distanceVector.getX()) * 2, Math.abs(distanceVector.getY()) * 2);
        }
    }