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

Unified Diff: Source/core/paint/ObjectPainter.cpp

Issue 1343773002: Compute outline mid-line in way that works with negative start-values (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 3 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 | « LayoutTests/fast/borders/outline-negative-start-expected.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/paint/ObjectPainter.cpp
diff --git a/Source/core/paint/ObjectPainter.cpp b/Source/core/paint/ObjectPainter.cpp
index 2b97de35eaa7d51a9c9bf13eae74bc4bd45cc19a..0b06bc529373bc48d50c38c777caa6903b9a0b30 100644
--- a/Source/core/paint/ObjectPainter.cpp
+++ b/Source/core/paint/ObjectPainter.cpp
@@ -342,14 +342,18 @@ void ObjectPainter::drawDashedOrDottedBoxSide(GraphicsContext* graphicsContext,
switch (side) {
case BSBottom:
- case BSTop:
- graphicsContext->drawLine(IntPoint(x1, (y1 + y2) / 2), IntPoint(x2, (y1 + y2) / 2));
+ case BSTop: {
+ int midY = y1 + thickness / 2;
+ graphicsContext->drawLine(IntPoint(x1, midY), IntPoint(x2, midY));
break;
+ }
case BSRight:
- case BSLeft:
- graphicsContext->drawLine(IntPoint((x1 + x2) / 2, y1), IntPoint((x1 + x2) / 2, y2));
+ case BSLeft: {
+ int midX = x1 + thickness / 2;
+ graphicsContext->drawLine(IntPoint(midX, y1), IntPoint(midX, y2));
break;
}
+ }
graphicsContext->setShouldAntialias(wasAntialiased);
graphicsContext->setStrokeStyle(oldStrokeStyle);
}
« no previous file with comments | « LayoutTests/fast/borders/outline-negative-start-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698