Restructured for making a gem.
Removed (incorrect) negative width/height handling.