From 0e264b005307cf90741d94b1619940fec20da11a Mon Sep 17 00:00:00 2001 From: "Shimeng (Simon) Wang" Date: Mon, 29 Mar 2010 14:56:55 -0700 Subject: Add 2 pixel padding and draw 2 pixel border for flash-on-demand. Issue: 2411524 Change-Id: I04c94b8122cd85dda071a85f74a054a613b39e8c --- WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'WebKit/android/WebCoreSupport') diff --git a/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp b/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp index b0b9b35..424617b 100644 --- a/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp +++ b/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp @@ -1049,10 +1049,17 @@ public: ctx->save(); ctx->clip(frameRect()); - // Draw a 1 pixel light gray border ctx->setFillColor(Color::white, DeviceColorSpace); - ctx->setStrokeColor(Color::lightGray, DeviceColorSpace); - ctx->drawRect(frameRect()); + ctx->fillRect(frameRect()); + if (frameRect().contains(imageRect)) { + // Leave a 2 pixel padding. + const int pixelWidth = 2; + IntRect innerRect = frameRect(); + innerRect.inflate(-pixelWidth); + // Draw a 2 pixel light gray border. + ctx->setStrokeColor(Color::lightGray, DeviceColorSpace); + ctx->strokeRect(innerRect, pixelWidth); + } // Draw the image in the center ctx->drawImage(image.get(), DeviceColorSpace, imageRect.location()); -- cgit v1.1