Bug 127819 - [iOS] round the scrollview content size to natural numbers
Summary: [iOS] round the scrollview content size to natural numbers
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Benjamin Poulain
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-28 17:39 PST by Benjamin Poulain
Modified: 2014-08-19 22:34 PDT (History)
0 users

See Also:


Attachments
Patch (1.99 KB, patch)
2014-01-28 17:45 PST, Benjamin Poulain
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Benjamin Poulain 2014-01-28 17:39:04 PST
[iOS] round the scrollview content size to natural numbers
Comment 1 Benjamin Poulain 2014-01-28 17:45:30 PST
Created attachment 222536 [details]
Patch
Comment 2 Simon Fraser (smfr) 2014-01-29 16:32:54 PST
Comment on attachment 222536 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=222536&action=review

> Source/WebKit2/UIProcess/API/ios/WKViewIOS.mm:110
> -    CGSize contentsSizeInScrollViewCoordinates = CGSizeMake(newSize.width * zoomScale, newSize.height * zoomScale);
> +    CGSize contentsSizeInScrollViewCoordinates = CGSizeMake(std::round(newSize.width * zoomScale), std::round(newSize.height * zoomScale));

Should we also adjust the scale so it still reflects the scaling after rounding?
Comment 3 Benjamin Poulain 2014-01-29 16:55:01 PST
(In reply to comment #2)
> (From update of attachment 222536 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=222536&action=review
> 
> > Source/WebKit2/UIProcess/API/ios/WKViewIOS.mm:110
> > -    CGSize contentsSizeInScrollViewCoordinates = CGSizeMake(newSize.width * zoomScale, newSize.height * zoomScale);
> > +    CGSize contentsSizeInScrollViewCoordinates = CGSizeMake(std::round(newSize.width * zoomScale), std::round(newSize.height * zoomScale));
> 
> Should we also adjust the scale so it still reflects the scaling after rounding?

That sounds like a good idea.
Comment 4 Benjamin Poulain 2014-01-30 15:48:22 PST
Comment on attachment 222536 [details]
Patch

Simon pointed out this is incomplete.
Comment 5 Benjamin Poulain 2014-08-19 22:34:35 PDT
I fixed that somewhere else IIRC.