snwau/SWSnapshotStackView — Issue #2: Reducing matte frame width results in uneven rendering
Author: snwau
Created: 2012-01-10 03:52:13+00:00
State: open
Labels: Bug

Raised by Cho Seungbo on 9 January 2012 within [Cocoa Controls](http://http://cocoacontrols.com/platforms/ios/controls/swsnapshotstackview) comments:

> When I set `SWSnapshotStackViewMatteWidth = 3`, the margin of left and top looks 3, but the margin of right and bottom is 2.

Suspect it's a rounding issue in frame calculations. As I round both the calculated matte frame and UIImage rectangle to make sure they are aligned appropriately for drawing to avoid unnecessary anti-aliasing (i.e. drawing between pixels, etc).
Lines are drawn on 0.5 point coordinates, UIImage drawn on integer coordinates.

Relates to known issue of using view with smaller frame sizes and scaling of effects to better suit.