Use the correct value for line size - it's in longs, not pixels! Bug-finder credit for this (a careless mistake of mine, really) is due to Marcus Comstedt.