$attr{$_} = $self->$_ if $self->${\"has_$_"} for qw/x y w h/;