Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(254)

Unified Diff: third_party/WebKit/Source/core/paint/ImagePainter.cpp

Issue 2386033002: Scale focus outline thickness with zoom level. (Closed)
Patch Set: return if outline width is 0 Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/paint/ImagePainter.cpp
diff --git a/third_party/WebKit/Source/core/paint/ImagePainter.cpp b/third_party/WebKit/Source/core/paint/ImagePainter.cpp
index e802681814f31e2d851e2abf00a677e98541fbb2..3ed6ebf823d68f052bc106bc4f9434b4b674dc1e 100644
--- a/third_party/WebKit/Source/core/paint/ImagePainter.cpp
+++ b/third_party/WebKit/Source/core/paint/ImagePainter.cpp
@@ -16,6 +16,7 @@
#include "core/page/Page.h"
#include "core/paint/BoxPainter.h"
#include "core/paint/LayoutObjectDrawingRecorder.h"
+#include "core/paint/ObjectPainter.h"
#include "core/paint/PaintInfo.h"
#include "platform/geometry/LayoutPoint.h"
#include "platform/graphics/Path.h"
@@ -51,8 +52,9 @@ void ImagePainter::paintAreaElementFocusRing(const PaintInfo& paintInfo,
// LayoutTheme::themeDrawsFocusRing here.
const ComputedStyle& areaElementStyle = *areaElement.ensureComputedStyle();
- int outlineWidth = areaElementStyle.outlineWidth();
- if (!outlineWidth)
+ // If the outline width is 0 we want to avoid drawing anything even if we
+ // don't use the value directly.
+ if (!areaElementStyle.outlineWidth())
return;
Path path = areaElement.getPath(&m_layoutImage);
@@ -79,7 +81,8 @@ void ImagePainter::paintAreaElementFocusRing(const PaintInfo& paintInfo,
paintInfo.context.save();
paintInfo.context.clip(pixelSnappedIntRect(focusRect));
paintInfo.context.drawFocusRing(
- path, outlineWidth, areaElementStyle.outlineOffset(),
+ path, ObjectPainter::getOutlineStrokeWidth(areaElementStyle),
+ areaElementStyle.outlineOffset(),
m_layoutImage.resolveColor(areaElementStyle, CSSPropertyOutlineColor));
paintInfo.context.restore();
}

Powered by Google App Engine
This is Rietveld 408576698