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

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

Issue 1824003002: Document how effective zoom relates to StyleImage sizing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@straighten-out-zoom-and-border
Patch Set: Created 4 years, 9 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/style/StyleImage.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/paint/NinePieceImagePainter.cpp
diff --git a/third_party/WebKit/Source/core/paint/NinePieceImagePainter.cpp b/third_party/WebKit/Source/core/paint/NinePieceImagePainter.cpp
index 51d82366c8513042c31c0e23ca7ca5ee4d94cca8..3eae2c371d3ab249e6935e94f82e9f2271dd48e0 100644
--- a/third_party/WebKit/Source/core/paint/NinePieceImagePainter.cpp
+++ b/third_party/WebKit/Source/core/paint/NinePieceImagePainter.cpp
@@ -49,6 +49,8 @@ bool NinePieceImagePainter::paint(GraphicsContext& graphicsContext, const Layout
rectWithOutsets.expand(style.imageOutsets(ninePieceImage));
LayoutRect borderImageRect = rectWithOutsets;
+ // NinePieceImage returns the image slices without effective zoom applied and thus we compute
+ // the nine piece grid on top of the image in unzoomed coordinates.
LayoutSize defaultObjectSize = borderImageRect.size();
defaultObjectSize.scale(1 / style.effectiveZoom());
IntSize imageSize = roundedIntSize(styleImage->imageSize(m_layoutObject, 1, defaultObjectSize));
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/style/StyleImage.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698