custom deserializer for rectangle2d.