Modified: trunk/Source/WebCore/ChangeLog (137208 => 137209)
--- trunk/Source/WebCore/ChangeLog 2012-12-10 22:42:32 UTC (rev 137208)
+++ trunk/Source/WebCore/ChangeLog 2012-12-10 22:53:45 UTC (rev 137209)
@@ -1,3 +1,18 @@
+2012-12-07 Simon Fraser <[email protected]>
+
+ Tidy up the tiled scrolling indicator, fix with zooming
+ https://bugs.webkit.org/show_bug.cgi?id=104386
+
+ Reviewed by Tim Horton.
+
+ Fix the tiled scrolling indicator to not get tiny when zooming,
+ to not poke out of the bottom of the window, and to not look
+ so crappy.
+
+ * platform/graphics/ca/mac/TileCache.mm:
+ (WebCore::TileCache::updateTileCoverageMap):
+ (WebCore::TileCache::drawTileMapContents):
+
2012-12-10 Sheriff Bot <[email protected]>
Unreviewed, rolling out r136817.
Modified: trunk/Source/WebCore/platform/graphics/ca/mac/TileCache.mm (137208 => 137209)
--- trunk/Source/WebCore/platform/graphics/ca/mac/TileCache.mm 2012-12-10 22:42:32 UTC (rev 137208)
+++ trunk/Source/WebCore/platform/graphics/ca/mac/TileCache.mm 2012-12-10 22:53:45 UTC (rev 137209)
@@ -509,6 +509,7 @@
{
FloatRect containerBounds = bounds();
FloatRect visibleRect = this->visibleRect();
+ visibleRect.contract(4, 4); // Layer is positioned 2px from top and left edges.
float widthScale = 1;
float scale = 1;
@@ -517,15 +518,16 @@
scale = std::min(widthScale, visibleRect.height() / containerBounds.height());
}
+ float indicatorScale = scale * m_scale;
FloatRect mapBounds = containerBounds;
- mapBounds.scale(scale, scale);
+ mapBounds.scale(indicatorScale, indicatorScale);
BEGIN_BLOCK_OBJC_EXCEPTIONS
[m_tiledScrollingIndicatorLayer.get() setBounds:mapBounds];
[m_tiledScrollingIndicatorLayer.get() setNeedsDisplay];
- visibleRect.scale(scale, scale);
+ visibleRect.scale(indicatorScale, indicatorScale);
visibleRect.expand(2, 2);
[[m_tiledScrollingIndicatorLayer.get() visibleRectFrameLayer] setFrame:visibleRect];
@@ -686,16 +688,17 @@
CGContextSetRGBFillColor(context, 1, 1, 1, 1);
CGContextSetRGBStrokeColor(context, 0, 0, 0, 1);
- CGContextSetLineWidth(context, 1 / scaleFactor);
CGFloat contextScale = scaleFactor / scale();
CGContextScaleCTM(context, contextScale, contextScale);
+
+ CGContextSetLineWidth(context, 0.5 / contextScale);
for (TileMap::const_iterator it = m_tiles.begin(), end = m_tiles.end(); it != end; ++it) {
WebTileLayer* tileLayer = it->value.get();
CGRect frame = [tileLayer frame];
+ CGContextFillRect(context, frame);
CGContextStrokeRect(context, frame);
- CGContextFillRect(context, frame);
}
}