<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body><span class="vcard"><a class="email" href="mailto:simon.fraser@apple.com" title="Simon Fraser (smfr) <simon.fraser@apple.com>"> <span class="fn">Simon Fraser (smfr)</span></a>
</span> changed
<a class="bz_bug_link
bz_status_NEW "
title="NEW - Autoscrolling from a drag selection does not work in full screen, or when the window is against the screen edge"
href="https://bugs.webkit.org/show_bug.cgi?id=155858">bug 155858</a>
<br>
<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>What</th>
<th>Removed</th>
<th>Added</th>
</tr>
<tr>
<td style="text-align:right;">Attachment #274927 Flags</td>
<td>review?
</td>
<td>review-
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - Autoscrolling from a drag selection does not work in full screen, or when the window is against the screen edge"
href="https://bugs.webkit.org/show_bug.cgi?id=155858#c7">Comment # 7</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - Autoscrolling from a drag selection does not work in full screen, or when the window is against the screen edge"
href="https://bugs.webkit.org/show_bug.cgi?id=155858">bug 155858</a>
from <span class="vcard"><a class="email" href="mailto:simon.fraser@apple.com" title="Simon Fraser (smfr) <simon.fraser@apple.com>"> <span class="fn">Simon Fraser (smfr)</span></a>
</span></b>
<pre>Comment on <span class=""><a href="attachment.cgi?id=274927&action=diff" name="attach_274927" title="Patch">attachment 274927</a> <a href="attachment.cgi?id=274927&action=edit" title="Patch">[details]</a></span>
Patch
View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=274927&action=review">https://bugs.webkit.org/attachment.cgi?id=274927&action=review</a>
<span class="quote">> Source/WebCore/page/mac/EventHandlerMac.mm:1149
> + CGFloat screenLeftEdge = screenRect.x();
> + CGFloat insetScreenLeftEdge = screenLeftEdge + EDGE_DISTANCE_THRESHOLD;
> + CGFloat screenRightEdge = screenLeftEdge + screenRect.width();
> + CGFloat insetScreenRightEdge = screenRightEdge - EDGE_DISTANCE_THRESHOLD;
> + if (screenPoint.x() >= screenLeftEdge && screenPoint.x() < insetScreenLeftEdge) {
> + CGFloat distanceFromEdge = screenPoint.x() - screenLeftEdge - EDGE_DISTANCE_THRESHOLD;
> + if (distanceFromEdge < 0)
> + adjustmentFactor.setWidth((distanceFromEdge / EDGE_DISTANCE_THRESHOLD) * PIXELS_MULTIPLIER);
> + } else if (screenPoint.x() >= insetScreenRightEdge && screenPoint.x() < screenRightEdge) {
> + CGFloat distanceFromEdge = EDGE_DISTANCE_THRESHOLD - (screenRightEdge - screenPoint.x());
> + if (distanceFromEdge > 0)
> + adjustmentFactor.setWidth((distanceFromEdge / EDGE_DISTANCE_THRESHOLD) * PIXELS_MULTIPLIER);
> + }
> +
> + CGFloat screenTopEdge = screenRect.y();
> + CGFloat insetScreenTopEdge = screenTopEdge + EDGE_DISTANCE_THRESHOLD;
> + CGFloat screenBottomEdge = screenTopEdge + screenRect.height();
> + CGFloat insetScreenBottomEdge = screenBottomEdge - EDGE_DISTANCE_THRESHOLD;
> +
> + if (screenPoint.y() >= screenTopEdge && screenPoint.y() < insetScreenTopEdge) {
> + CGFloat distanceFromEdge = screenPoint.y() - screenTopEdge - EDGE_DISTANCE_THRESHOLD;
> + if (distanceFromEdge < 0)
> + adjustmentFactor.setHeight((distanceFromEdge / EDGE_DISTANCE_THRESHOLD) * PIXELS_MULTIPLIER);
> + } else if (screenPoint.y() >= insetScreenBottomEdge && screenPoint.y() < screenBottomEdge) {
> + CGFloat distanceFromEdge = EDGE_DISTANCE_THRESHOLD - (screenBottomEdge - screenPoint.y());
> + if (distanceFromEdge > 0)
> + adjustmentFactor.setHeight((distanceFromEdge / EDGE_DISTANCE_THRESHOLD) * PIXELS_MULTIPLIER);
> + }</span >
I think you should do all this with floats. No reason to use CG types here.
You can also use screenRect.maxX() etc rather than left + width.
<span class="quote">> Source/WebCore/platform/ios/PlatformScreenIOS.mm:127
> + return FloatRect([[getUIScreenClass() mainScreen] _referenceBounds]);</span >
Don't we have an implicit conversions from CGRect to FloatRect?
<span class="quote">> Source/WebKit2/UIProcess/WebPageProxy.cpp:2342
> + m_process->send(Messages::WebPage::WindowScreenDidChange(displayID, screenRect), m_pageID);</span >
I'm not sure why you have to pass a screenRect here. Wen can get the screen rect from the displayID in the web process.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>