Chameleon icon indicating copy to clipboard operation
Chameleon copied to clipboard

Fix rounding bias in UIView.

Open michaelmelanson opened this issue 11 years ago • 0 comments

This patch set fixes a 'drifting' issue in the autoresizing logic. This behaviour is caused by the rounding bias introduced by the use of floorf function in -[UIView _superviewSizeDidChangeFrom:(CGSize)oldSize to:(CGSize)newSize].

It fixes it by keeping an internal CGRect for the UIView's frame using unrounded floats. When updating the internal CGLayer for the view, it rounds it using CGRectIntegral to prevent sub-pixel blurring when the autoresizing puts a view at non-integer coordinates.

It then removes the unnecessary calls to floorf in the autoresizing calculations.

Fixes BigZaphod/Chameleon#82.

michaelmelanson avatar Sep 10 '13 15:09 michaelmelanson